From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: Re: [PATCH][next] scsi: isci: Avoid -Wflex-array-member-not-at-end warning
Date: Tue, 7 Oct 2025 11:43:42 +0100 [thread overview]
Message-ID: <729db47f-ac08-4390-a6c2-f0bf01da64c0@embeddedor.com> (raw)
In-Reply-To: <aM09bpl1xj9KZSZl@kspp>
Hi all,
Friendly ping: who can take this, please?
Thanks!
-Gustavo
On 9/19/25 12:24, 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 (which happens to be in a union,
> so we're moving the entire union) to the end of the corresponding
> structure. Notice that `struct ssp_response_iu` is a flexible
> structure, this is a structure that contains a flexible-array member.
>
> With these changes fix the following warning:
>
> drivers/scsi/isci/task.h:92:11: 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>
> ---
> drivers/scsi/isci/task.h | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/isci/task.h b/drivers/scsi/isci/task.h
> index f96633fa6939..d05d09c1263d 100644
> --- a/drivers/scsi/isci/task.h
> +++ b/drivers/scsi/isci/task.h
> @@ -85,15 +85,17 @@ struct isci_tmf {
>
> struct completion *complete;
> enum sas_protocol proto;
> + unsigned char lun[8];
> + u16 io_tag;
> + enum isci_tmf_function_codes tmf_code;
> + int status;
> +
> + /* Must be last --ends in a flexible-array member. */
> union {
> struct ssp_response_iu resp_iu;
> struct dev_to_host_fis d2h_fis;
> u8 rsp_buf[SSP_RESP_IU_MAX_SIZE];
> } resp;
> - unsigned char lun[8];
> - u16 io_tag;
> - enum isci_tmf_function_codes tmf_code;
> - int status;
> };
>
> static inline void isci_print_tmf(struct isci_host *ihost, struct isci_tmf *tmf)
next prev parent reply other threads:[~2025-10-07 22:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-19 11:24 Gustavo A. R. Silva
2025-10-07 10:43 ` Gustavo A. R. Silva [this message]
2025-10-14 21:38 ` Martin K. Petersen
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=729db47f-ac08-4390-a6c2-f0bf01da64c0@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=gustavoars@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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
all inboxes | Powered by JetHome®