Skip to content

Commit 327e0ab

Browse files
fengidrimstsirkin
authored andcommitted
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 <xuanzhuo@linux.alibaba.com> Acked-by: Jason Wang <jasowang@redhat.com> Message-Id: <20231010031120.81272-5-xuanzhuo@linux.alibaba.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent 70e16c9 commit 327e0ab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/virtio/virtio_pci_modern_dev.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ static inline void check_offsets(void)
203203
offsetof(struct virtio_pci_common_cfg, queue_used_lo));
204204
BUILD_BUG_ON(VIRTIO_PCI_COMMON_Q_USEDHI !=
205205
offsetof(struct virtio_pci_common_cfg, queue_used_hi));
206+
BUILD_BUG_ON(VIRTIO_PCI_COMMON_Q_NDATA !=
207+
offsetof(struct virtio_pci_modern_common_cfg, queue_notify_data));
208+
BUILD_BUG_ON(VIRTIO_PCI_COMMON_Q_RESET !=
209+
offsetof(struct virtio_pci_modern_common_cfg, queue_reset));
206210
}
207211

208212
/*

0 commit comments

Comments
 (0)