linux/drivers/scsi/megaraid
Gustavo A. R. Silva 81cb6c228f scsi: megaraid_sas: Avoid a couple -Wflex-array-member-not-at-end warnings
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
getting ready to enable it, globally.

Use the new TRAILING_OVERLAP() helper to fix the following warnings:

drivers/scsi/megaraid/megaraid_sas_fusion.h:1153:31: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
drivers/scsi/megaraid/megaraid_sas_fusion.h:1198:32: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

This helper creates a union between a flexible-array member (FAM) and a
set of MEMBERS that would otherwise follow it --in this case 'struct
MR_LD_SPAN_MAP ldSpanMap[MAX_LOGICAL_DRIVES_DYN]' and 'struct
MR_LD_SPAN_MAP ldSpanMap[MAX_LOGICAL_DRIVES]' in the corresponding
structures.

This overlays the trailing members onto the FAM (struct MR_LD_SPAN_MAP
ldSpanMap[];) while keeping the FAM and the start of MEMBERS aligned.

The static_assert() ensures this alignment remains, and it's
intentionally placed inmediately after the corresponding structures --no
blank line in between.

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://patch.msgid.link/aM1E7Xa8qYdZ598N@kspp
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
History 2025-10-20 12:00:42 -04:00
..
Kconfig.megaraid scsi: megaraid: Indent Kconfig option help text 2024-04-08 21:30:03 -04:00
Makefile scsi: megaraid_sas: Export RAID map through debugfs 2019-06-18 19:46:20 -04:00
mbox_defs.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
mega_common.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
megaraid_ioctl.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
megaraid_mbox.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
megaraid_mbox.h treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
megaraid_mm.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
megaraid_mm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
megaraid_sas.h scsi: megaraid_sas: Driver version update to 07.734.00.00-rc1 2025-04-03 11:16:19 -04:00
megaraid_sas_base.c scsi: switch ->bios_param() to passing gendisk 2025-08-13 02:59:28 -04:00
megaraid_sas_debugfs.c scsi: megaraid_sas: Remove unused including <linux/version.h> 2019-06-18 19:46:25 -04:00
megaraid_sas_fp.c overflow: Add struct_size_t() helper 2023-05-26 13:52:19 -07:00
megaraid_sas_fusion.c Merge branch '6.15/scsi-queue' into 6.15/scsi-fixes 2025-04-08 22:04:31 -04:00
megaraid_sas_fusion.h scsi: megaraid_sas: Avoid a couple -Wflex-array-member-not-at-end warnings 2025-10-20 12:00:42 -04:00