linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Steven Price <steven.price@arm.com>
To: Cristian Marussi <cristian.marussi@arm.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: arnd@arndb.de, sudeep.holla@arm.com
Subject: Re: [PATCH 2/3] firmware: arm_scmi: Remove unneeded __packed attribute
Date: Mon, 13 Jul 2020 12:20:43 +0100	[thread overview]
Message-ID: <751ee628-ff38-a383-5832-aab4905af32b@arm.com> (raw)
In-Reply-To: <20200710133919.39792-2-cristian.marussi@arm.com>

On 10/07/2020 14:39, Cristian Marussi wrote:
> Remove __packed attribute from struct scmi_event_header.
> 
> Signed-off-by: Cristian Marussi <cristian.marussi@arm.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;
>   
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-07-13 11:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 13:39 [PATCH 1/3] firmware: arm_scmi: Remove zero-length array in SCMI Notifications Cristian Marussi
2020-07-10 13:39 ` [PATCH 2/3] firmware: arm_scmi: Remove unneeded __packed attribute Cristian Marussi
2020-07-13 11:18   ` Steven Price
2020-07-13 11:20   ` Steven Price [this message]
2020-07-13 13:07     ` Cristian Marussi
2020-07-15 10:56       ` Steven Price
2020-07-10 13:39 ` [PATCH 3/3] firmware: arm_scmi: Remove fixed size fields from reports/scmi_event_header Cristian Marussi
2020-07-13 13:00 ` [PATCH 1/3] firmware: arm_scmi: Remove zero-length array in SCMI Notifications Sudeep Holla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=751ee628-ff38-a383-5832-aab4905af32b@arm.com \
    --to=steven.price@arm.com \
    --cc=arnd@arndb.de \
    --cc=cristian.marussi@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudeep.holla@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).