[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <751ee628-ff38-a383-5832-aab4905af32b@arm.com>
Date: Mon, 13 Jul 2020 12:20:43 +0100
From: Steven Price <steven.price@....com>
To: Cristian Marussi <cristian.marussi@....com>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Cc: arnd@...db.de, sudeep.holla@....com
Subject: Re: [PATCH 2/3] firmware: arm_scmi: Remove unneeded __packed
attribute
On 10/07/2020 14:39, Cristian Marussi wrote:
> Remove __packed attribute from struct scmi_event_header.
>
> Signed-off-by: Cristian Marussi <cristian.marussi@....com>
A drive-by review. But this doesn't look safe to me. sizeof(struct
scmi_event_header) is used in several places and this change will modify
that from 13 to 16, but leave the structure members at the same offset
(as the members are naturally aligned). In particular the naïve header
size is now bigger than the offset to payld.
What is the justification for __packed being 'unneeded'?
Steve
> ---
> drivers/firmware/arm_scmi/notify.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi/notify.c
> index c4d006cfde88..752415367305 100644
> --- a/drivers/firmware/arm_scmi/notify.c
> +++ b/drivers/firmware/arm_scmi/notify.c
> @@ -258,7 +258,7 @@ struct scmi_event_header {
> u8 evt_id;
> size_t payld_sz;
> u8 payld[];
> -} __packed;
> +};
>
> struct scmi_registered_event;
>
>
Powered by blists - more mailing lists