]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
virtio_pci: add build offset check for the new common cfg items
authorXuan Zhuo <xuanzhuo@linux.alibaba.com>
Tue, 10 Oct 2023 03:11:20 +0000 (11:11 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 1 Nov 2023 13:19:59 +0000 (09:19 -0400)
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>
drivers/virtio/virtio_pci_modern_dev.c

index 9cb601e16688dccc8373fef26a604e1ea5766765..d312443d6569020874a358396a1f081520890245 100644 (file)
@@ -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));
 }
 
 /*