From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Igor Russkikh <irusskikh@marvell.com>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [EXTERNAL] [PATCH][next] net: atlantic: Aavoid -Wflex-array-member-not-at-end warnings
Date: Tue, 6 Aug 2024 07:42:21 -0600 [thread overview]
Message-ID: <8e19df11-a64b-4fae-863a-c141612a3d36@embeddedor.com> (raw)
In-Reply-To: <0d0a030c-b1ba-77a7-71f5-55448f6797f6@marvell.com>
On 06/08/24 03:42, Igor Russkikh wrote:
>
>
> On 8/5/2024 5:32 PM, Gustavo A. R. Silva wrote:
>> -Wflex-array-member-not-at-end was introduced in GCC-14, and we are
>> getting ready to enable it, globally. Move the conflicting declaration to
>> the end of the structure. Notice that `struct hw_atl_utils_fw_rpc` ends in
>> a flexible-array member
>>
>> Fix the following warnings:
>>
>> drivers/net/ethernet/aquantia/atlantic/aq_hw.h:197:36: warning: structure
>> containing a flexible array member is not at the end of another structure
>> [-Wflex-array-member-not-at-end]
>>
>> drivers/net/ethernet/aquantia/atlantic/hw_atl/../aq_hw.h:197:36: warning:
>> structure containing a flexible array member is not at the end of another
>> structure [-Wflex-array-member-not-at-end]
>
> Hi Gustavo!
>
> I was abit curious about this variable length structure, because it looks strange and not actually used by driver.
>
> I've cross checked, and its really some outdated declaration. The structure is never used as as a flex sized struct.
Oh, this is great to know. Thanks for looking into this!
>
> So better would be to do just this:
>
> --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
> +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h
> @@ -226,7 +226,6 @@ struct __packed offload_info {
> struct offload_port_info ports;
> struct offload_ka_info kas;
> struct offload_rr_info rrs;
> - u8 buf[];
> };
>
> Let me know if you want to submit this, or I can do this as well.
>
Feel free to send a patch if you wish. :)
Thanks!
--
Gustavo
prev parent reply other threads:[~2024-08-06 13:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-05 15:32 [PATCH][next] net: atlantic: Aavoid -Wflex-array-member-not-at-end warnings Gustavo A. R. Silva
2024-08-06 9:42 ` [EXTERNAL] " Igor Russkikh
2024-08-06 13:42 ` Gustavo A. R. Silva [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=8e19df11-a64b-4fae-863a-c141612a3d36@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gustavoars@kernel.org \
--cc=irusskikh@marvell.com \
--cc=kuba@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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