From: Scott Branden <scott.branden@broadcom.com>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [RFC] misc: bcm-vk: avoid -Wflex-array-member-not-at-end warning
Date: Tue, 11 Mar 2025 10:20:05 -0700 [thread overview]
Message-ID: <9188b3d1-ee61-c1d1-f06e-854ffd2ccff7@broadcom.com> (raw)
In-Reply-To: <Z8_twT77rSIK-S_-@kspp>
Hi Gustavo,
On 2025-03-11 01:01, Gustavo A. R. Silva wrote:
> Hi all,
>
> I'm trying to fix the following warning:
>
> drivers/misc/bcm-vk/bcm_vk.h:415:32: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
>
> after a quick look, I don't see any code directly using the flexible
> array `data[]`, so this patch should probably suffice:
>
> diff --git a/drivers/misc/bcm-vk/bcm_vk.h b/drivers/misc/bcm-vk/bcm_vk.h
> index 386884c2a263..9344c2366a4b 100644
> --- a/drivers/misc/bcm-vk/bcm_vk.h
> +++ b/drivers/misc/bcm-vk/bcm_vk.h
> @@ -311,7 +311,6 @@ struct bcm_vk_peer_log {
> u32 wr_idx;
> u32 buf_size;
> u32 mask;
> - char data[];
> };
>
> What do you think?
If it is changed to data[0] does the warning go away? If not, you could
remove it or change the code to use it instead of the sizeof used to
calculate peer offset.
>
> Thanks
> --
> Gustavo
prev parent reply other threads:[~2025-03-11 17:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 8:01 Gustavo A. R. Silva
2025-03-11 17:20 ` Scott Branden [this message]
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=9188b3d1-ee61-c1d1-f06e-854ffd2ccff7@broadcom.com \
--to=scott.branden@broadcom.com \
--cc=arnd@arndb.de \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=gustavoars@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®