mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH 6/8][next] nvme: target: Avoid -Wflex-array-member-not-at-end warnings
Date: Mon, 24 Feb 2025 15:19:38 +0100	[thread overview]
Message-ID: <20250224141938.GB1088@lst.de> (raw)
In-Reply-To: <ef7a6920384ab2f8f83c0f630f94edc73cd65997.1739957534.git.gustavoars@kernel.org>

On Mon, Feb 24, 2025 at 08:30:10PM +1030, 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.
> 
> Change the type of the middle struct members currently causing trouble
> from `struct bio` to `struct bio_hdr`.
> 
> We also use `container_of()` whenever we need to retrieve a pointer to
> the flexible structure `struct bio`, through which we can access the
> flexible-array member in it, if necessary.
> 
> With these changes fix 38 of the following warnings:
> 
> drivers/nvme/target/nvmet.h:455:49: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
> drivers/nvme/target/nvmet.h:462:49: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
> 

I'm not sure where you bio_hdr structure comes from, but maybe that's
because you annoyingly split CC over the series, and by the number of
patches probably also bundled unrelated changes.

In general our first resort here should be to move embedded bio to the
of containing structures.  If that's not possible you'll need to explain
why.


  reply	other threads:[~2025-02-24 14:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24  9:53 [PATCH 0/8][next] Avoid a couple hundred " Gustavo A. R. Silva
2025-02-24  9:55 ` [PATCH 1/8][next] block: blk_types.h: Use struct_group_tagged() in flex struct bio Gustavo A. R. Silva
2025-02-24 16:39   ` Christoph Hellwig
2025-02-24  9:56 ` [PATCH 2/8][next] md/raid5-ppl: Avoid -Wflex-array-member-not-at-end warning Gustavo A. R. Silva
2025-02-24  9:57 ` [PATCH 3/8][next] xfs: Avoid -Wflex-array-member-not-at-end warnings Gustavo A. R. Silva
2025-02-24 19:12   ` Darrick J. Wong
2025-02-24 21:45   ` Dave Chinner
2025-02-24  9:58 ` [PATCH 4/8][next] erofs: " Gustavo A. R. Silva
2025-02-24  9:59 ` [PATCH 5/8][next] btrfs: " Gustavo A. R. Silva
2025-02-24 10:00 ` [PATCH 6/8][next] nvme: target: " Gustavo A. R. Silva
2025-02-24 14:19   ` Christoph Hellwig [this message]
2025-02-25  1:51     ` Gustavo A. R. Silva
2025-02-24 10:00 ` [PATCH 7/8][next] md/raid5: " Gustavo A. R. Silva
2025-02-24 10:01 ` [PATCH 8/8][next] bcache: " Gustavo A. R. Silva
2025-02-24 14:04   ` Coly Li

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=20250224141938.GB1088@lst.de \
    --to=hch@lst.de \
    --cc=gustavoars@kernel.org \
    --cc=kch@nvidia.com \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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®