diff mbox series

virtio_gpio: drop packed attribute

Message ID 20211101091122.442512-1-mst@redhat.com
State New
Headers show
Series virtio_gpio: drop packed attribute | expand

Commit Message

Michael S. Tsirkin Nov. 1, 2021, 9:11 a.m. UTC
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.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/uapi/linux/virtio_gpio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Viresh Kumar Nov. 2, 2021, 3:33 a.m. UTC | #1
On 01-11-21, 05:11, Michael S. Tsirkin wrote:
> 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.
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  include/uapi/linux/virtio_gpio.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/virtio_gpio.h b/include/uapi/linux/virtio_gpio.h
> index 0445f905d8cc..25c95a034674 100644
> --- a/include/uapi/linux/virtio_gpio.h
> +++ b/include/uapi/linux/virtio_gpio.h
> @@ -25,7 +25,7 @@ struct virtio_gpio_config {
>  	__le16 ngpio;
>  	__u8 padding[2];
>  	__le32 gpio_names_size;
> -} __packed;
> +};

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Bartosz Golaszewski Nov. 4, 2021, 3:38 p.m. UTC | #2
On Mon, Nov 1, 2021 at 10:11 AM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> 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.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  include/uapi/linux/virtio_gpio.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/uapi/linux/virtio_gpio.h b/include/uapi/linux/virtio_gpio.h
> index 0445f905d8cc..25c95a034674 100644
> --- a/include/uapi/linux/virtio_gpio.h
> +++ b/include/uapi/linux/virtio_gpio.h
> @@ -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 {
> --
> MST
>

Applied, thanks!

Bart
diff mbox series

Patch

diff --git a/include/uapi/linux/virtio_gpio.h b/include/uapi/linux/virtio_gpio.h
index 0445f905d8cc..25c95a034674 100644
--- a/include/uapi/linux/virtio_gpio.h
+++ b/include/uapi/linux/virtio_gpio.h
@@ -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 {