aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXuan Zhuo <[email protected]>2023-10-10 11:11:20 +0800
committerMichael S. Tsirkin <[email protected]>2023-11-01 09:19:59 -0400
commit327e0ab32cd050513ffaf0aa9234884a2b4ca424 (patch)
tree139399bad4b5ec356e534788ac1f0510ded7c39d
parent70e16c90ee23233bdd45462e1ebba72ff0c25c3a (diff)
virtio_pci: add build offset check for the new common cfg items
Add checks to the check_offsets(void) for queue_notify_data and queue_reset. Signed-off-by: Xuan Zhuo <[email protected]> Acked-by: Jason Wang <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
-rw-r--r--drivers/virtio/virtio_pci_modern_dev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/virtio/virtio_pci_modern_dev.c b/drivers/virtio/virtio_pci_modern_dev.c
index 9cb601e16688..d312443d6569 100644
--- a/drivers/virtio/virtio_pci_modern_dev.c
+++ b/drivers/virtio/virtio_pci_modern_dev.c
@@ -203,6 +203,10 @@ static inline void check_offsets(void)
offsetof(struct virtio_pci_common_cfg, queue_used_lo));
BUILD_BUG_ON(VIRTIO_PCI_COMMON_Q_USEDHI !=
offsetof(struct virtio_pci_common_cfg, queue_used_hi));
+ BUILD_BUG_ON(VIRTIO_PCI_COMMON_Q_NDATA !=
+ offsetof(struct virtio_pci_modern_common_cfg, queue_notify_data));
+ BUILD_BUG_ON(VIRTIO_PCI_COMMON_Q_RESET !=
+ offsetof(struct virtio_pci_modern_common_cfg, queue_reset));
}
/*