netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Louis Peens <louis.peens@corigine.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	oss-drivers@corigine.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH][next] nfp: Avoid -Wflex-array-member-not-at-end warnings
Date: Mon, 1 Apr 2024 21:24:24 -0700	[thread overview]
Message-ID: <20240401212424.34a9a9cd@kernel.org> (raw)
In-Reply-To: <ZgYWlkxdrrieDYIu@neat>

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

  reply	other threads:[~2024-04-02  4:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-29  1:17 [PATCH][next] nfp: Avoid -Wflex-array-member-not-at-end warnings Gustavo A. R. Silva
2024-04-02  4:24 ` Jakub Kicinski [this message]
2024-04-03  0:49   ` Gustavo A. R. Silva
2024-04-03  1:10 ` patchwork-bot+netdevbpf

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=20240401212424.34a9a9cd@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gustavoars@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=louis.peens@corigine.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@corigine.com \
    --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;
as well as URLs for NNTP newsgroup(s).