[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240401212424.34a9a9cd@kernel.org>
Date: Mon, 1 Apr 2024 21:24:24 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: "Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc: Louis Peens <louis.peens@...igine.com>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
<pabeni@...hat.com>, oss-drivers@...igine.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH][next] nfp: Avoid -Wflex-array-member-not-at-end
warnings
On Thu, 28 Mar 2024 19:17:10 -0600 Gustavo A. R. Silva wrote:
> --- a/drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c
> +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c
> @@ -34,8 +34,11 @@ enum nfp_dumpspec_type {
>
> /* generic type plus length */
> struct nfp_dump_tl {
> - __be32 type;
> - __be32 length; /* chunk length to follow, aligned to 8 bytes */
> + /* New members must be added within the struct_group() macro below. */
> + struct_group_tagged(nfp_dump_tl_hdr, hdr,
> + __be32 type;
> + __be32 length; /* chunk length to follow, aligned to 8 bytes */
> + );
> char data[];
> };
I counted 9 references to nfp_dump_tl->data.
Better to add:
static void *nfp_dump_tl_data(struct nfp_dump_tl *spec)
{
return &spec[1];
}
and delete the flex array completely.
--
pw-bot: cr
Powered by blists - more mailing lists