Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: isci: Avoid -Wflex-array-member-not-at-end warning

-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>
Link: https://patch.msgid.link/aM09bpl1xj9KZSZl@kspp
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Gustavo A. R. Silva and committed by
Martin K. Petersen
11956e4b 3a866087

+6 -4
+6 -4
drivers/scsi/isci/task.h
··· 85 85 86 86 struct completion *complete; 87 87 enum sas_protocol proto; 88 + unsigned char lun[8]; 89 + u16 io_tag; 90 + enum isci_tmf_function_codes tmf_code; 91 + int status; 92 + 93 + /* Must be last --ends in a flexible-array member. */ 88 94 union { 89 95 struct ssp_response_iu resp_iu; 90 96 struct dev_to_host_fis d2h_fis; 91 97 u8 rsp_buf[SSP_RESP_IU_MAX_SIZE]; 92 98 } resp; 93 - unsigned char lun[8]; 94 - u16 io_tag; 95 - enum isci_tmf_function_codes tmf_code; 96 - int status; 97 99 }; 98 100 99 101 static inline void isci_print_tmf(struct isci_host *ihost, struct isci_tmf *tmf)