Skip to contentSkip to conversation

virtio_gpio: drop packed attribute

PATCH Applied Michael S. Tsirkin 3 participants 3 messages Nov 1, 2021 – Nov 4, 2021

Subsystems (3)
lore
Share & tools
lore

Michael S. Tsirkin

author maintainer
#0 lore raw

PATCH 1/1 virtio_gpio: drop packed attribute

Declaring the struct packed here is mostly harmless, but gives a bad example for people to copy. As the struct is packed and aligned manually, let's just drop the attribute.

---
 include/uapi/linux/virtio_gpio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/virtio_gpio.h +1 -1
index 0445f905d8cc..25c95a034674 100644
@@ -25,7 +25,7 @@ struct virtio_gpio_config {
 	__le16 ngpio;
 	__u8 padding[2];
 	__le32 gpio_names_size;
-} __packed;
+};
 
 /* Virtio GPIO Request / Response */
 struct virtio_gpio_request {
Signature · 1 line
MST
Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines · Michael S. Tsirkin

Declaring the struct packed here is mostly harmless, but gives a bad example for people to copy. As the struct is packed and aligned manually, let's just drop the attribute.

---
 include/uapi/linux/virtio_gpio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/virtio_gpio.h +0 -0
index 0445f905d8cc..25c95a034674 100644

include/uapi/linux/virtio_gpio.h struct virtio_gpio_config { · line 28

Quoted 5 lines
include/uapi/linux/virtio_gpio.h +1 -1
@@ -25,7 +25,7 @@ struct virtio_gpio_config {
 	__le16 ngpio;
 	__u8 padding[2];
 	__le32 gpio_names_size;
-} __packed;
+};
Signature · 1 line
viresh
#2 lore raw
In reply to Michael S. Tsirkin
Quoted 25 lines · Michael S. Tsirkin

Declaring the struct packed here is mostly harmless, but gives a bad example for people to copy. As the struct is packed and aligned manually, let's just drop the attribute.

---
 include/uapi/linux/virtio_gpio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/virtio_gpio.h +1 -2
index 0445f905d8cc..25c95a034674 100644
@@ -25,7 +25,7 @@ struct virtio_gpio_config {
        __le16 ngpio;
        __u8 padding[2];
        __le32 gpio_names_size;
-} __packed;
+};
 
 /* Virtio GPIO Request / Response */
 struct virtio_gpio_request {
--
Quoted 2 lines

MST

Applied, thanks!

Bart