Skip to contentSkip to conversation

IB/hfi1: Avoid -Wflex-array-member-not-at-end warning

PATCH Applied Gustavo A. R. Silva 2 participants 2 messages Apr 1, 2025 – Apr 7, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 IB/hfi1: 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.

Remove unused flex-array member class_data from
struct opa_mad_notice_attr.

Fix the following warning:

drivers/infiniband/hw/hfi1/mad.c:23:36: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

---
Changes in v2:
- Remove unused flexible array. (Jason)

v1:
- Link: https://lore.kernel.org/linux-hardening/Z-WgwsCYIXaBxnvs@kspp/

 drivers/infiniband/hw/hfi1/mad.h | 1 -
 1 file changed, 1 deletion(-)
drivers/infiniband/hw/hfi1/mad.h +0 -1
index b6e3141253c4..d6dde762921a 100644
@@ -124,7 +124,6 @@ struct opa_mad_notice_attr {
 		} __packed ntc_2048;
 
 	};
-	u8	class_data[];
 };
 
 #define IB_VLARB_LOWPRI_0_31    1
Signature · 1 line
2.43.0
maintainer Applied
#1 lore raw
Quoted 15 lines · Gustavo A. R. Silva

-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally.

Remove unused flex-array member class_data from
struct opa_mad_notice_attr.

Fix the following warning:

drivers/infiniband/hw/hfi1/mad.c:23:36: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

---
Changes in v2:
- Remove unused flexible array. (Jason)

Quoted 5 lines

v1:
- Link: https://lore.kernel.org/linux-hardening/Z-WgwsCYIXaBxnvs@kspp/

 drivers/infiniband/hw/hfi1/mad.h | 1 -
 1 file changed, 1 deletion(-)

Applied to for-next, thanks

Jason