public inbox for linux-hardening@vger.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <chaitanyak@nvidia.com>
Cc: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-hardening@vger.kernel.org"
	<linux-hardening@vger.kernel.org>
Subject: Re: [PATCH][next] nvme-loop: Avoid -Wflex-array-member-not-at-end warning
Date: Mon, 31 Mar 2025 03:28:10 +0000	[thread overview]
Message-ID: <cefca512-2368-46ea-84f7-1e59fd1436d7@nvidia.com> (raw)
In-Reply-To: <Z-axRObjXYjIHGQC@kspp>

On 3/28/25 07:25, 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 nvme_loop_iod` is a flexible structure --a structure
> that contains a flexible-array member.

Indeed :-

  18 struct nvme_loop_iod {
  19         struct nvme_request     nvme_req;
  20         struct nvme_command     cmd;
  21         struct nvme_completion  cqe;
  22         struct nvmet_req        req;
  23         struct nvme_loop_queue  *queue;
  24         struct work_struct      work;
  25         struct sg_table sg_table;
  26         struct scatterlist      first_sgl[];
  27 };


> Fix the following warning:
>
> drivers/nvme/target/loop.c:36:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
>
> Signed-off-by: Gustavo A. R. Silva<gustavoars@kernel.org>

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



  reply	other threads:[~2025-03-31  3:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-28 14:25 [PATCH][next] nvme-loop: Avoid -Wflex-array-member-not-at-end warning Gustavo A. R. Silva
2025-03-31  3:28 ` Chaitanya Kulkarni [this message]
2025-04-03  4:45 ` Christoph Hellwig
2025-04-14 22:11 ` Sagi Grimberg
2025-04-16  0:20 ` Gustavo A. R. Silva
2025-04-16  5:43   ` Christoph Hellwig
2025-04-22 14:59     ` Gustavo A. R. Silva
2025-04-22  7:57 ` Christoph Hellwig

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=cefca512-2368-46ea-84f7-1e59fd1436d7@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=gustavoars@kernel.org \
    --cc=hch@lst.de \
    --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