Thread (44 messages) 44 messages, 6 authors, 2026-01-29
STALE129d REVIEWED: 7 (7M)

[PATCH v2 15/15] gpio: virtio: reorder fields to reduce struct padding

From: "Michael S. Tsirkin" <mst@redhat.com>
Date: 2026-01-05 08:23:58
Also in: kvm, linux-crypto, linux-doc, linux-gpio, linux-iommu, linux-scsi, lkml, virtualization
Subsystem: gpio subsystem, the rest, virtio gpio driver · Maintainers: Linus Walleij, Bartosz Golaszewski, Linus Torvalds, Enrico Weigelt, metux IT consult, Viresh Kumar

Reorder struct virtio_gpio_line fields to place the DMA buffers
(req/res) last.

This eliminates the padding from aligning struct size on
ARCH_DMA_MINALIGN.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 drivers/gpio/gpio-virtio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-virtio.c b/drivers/gpio/gpio-virtio.c
index b70294626770..ed6e0e90fa8a 100644
--- a/drivers/gpio/gpio-virtio.c
+++ b/drivers/gpio/gpio-virtio.c
@@ -26,11 +26,12 @@ struct virtio_gpio_line {
 	struct mutex lock; /* Protects line operation */
 	struct completion completion;
 
+	unsigned int rxlen;
+
 	__dma_from_device_group_begin();
 	struct virtio_gpio_request req;
 	struct virtio_gpio_response res;
 	__dma_from_device_group_end();
-	unsigned int rxlen;
 };
 
 struct vgpio_irq_line {
-- 
MST
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help