From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Kees Cook <keescook@chromium.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH][next] rpmsg: glink: Avoid -Wflex-array-member-not-at-end warnings
Date: Wed, 7 Aug 2024 14:43:24 -0600 [thread overview]
Message-ID: <41c0cb7a-6fd4-4757-8d1a-7466fa268666@embeddedor.com> (raw)
In-Reply-To: <202404290937.C22567C1@keescook>
>> @@ -48,7 +51,7 @@ struct glink_msg {
>> struct glink_defer_cmd {
>> struct list_head node;
>>
>> - struct glink_msg msg;
>> + struct glink_msg_hdr msg;
>> u8 data[];
>> };
>
> Instead of this change (and the container_of() uses below), I think you
> can just simply drop "data" here. I don't see anything using it except
> the struct_size()s which can all change their "data" argument to
> msg.data. e.g.:
Whaa.. I'm sorry, I totally missed this response. I think I was traveling
a lot back then.
>
> - dcmd = kzalloc(struct_size(dcmd, data, extra), GFP_ATOMIC);
> + dcmd = kzalloc(struct_size(dcmd, msg.data, extra), GFP_ATOMIC);
>
> With those changed, I think this patch becomes more readable.
Yes; I think I can change the code like this. :)
Thanks!
--
Gustavo
next prev parent reply other threads:[~2024-08-07 20:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-25 18:03 [PATCH][next] rpmsg: glink: Avoid -Wflex-array-member-not-at-end warnings Gustavo A. R. Silva
2024-04-29 16:38 ` Kees Cook
2024-08-07 20:43 ` Gustavo A. R. Silva [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-08-07 15:19 Gustavo A. R. Silva
2024-08-08 18:51 ` Kees Cook
2024-08-19 19:45 ` Gustavo A. R. Silva
2024-09-13 8:10 ` Gustavo A. R. Silva
2024-09-13 21:16 ` Bjorn Andersson
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=41c0cb7a-6fd4-4757-8d1a-7466fa268666@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=andersson@kernel.org \
--cc=gustavoars@kernel.org \
--cc=keescook@chromium.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).