Skip to contentSkip to conversation

ipw2x00: Replace zero-length array with DECLARE_FLEX_ARRAY() helper

PATCH In review Gustavo A. R. Silva 3 participants 3 messages Sep 26, 2022 – Sep 28, 2022

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

PATCH 1/1 ipw2x00: Replace zero-length array with DECLARE_FLEX_ARRAY() helper

Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations in anonymous union with the new DECLARE_FLEX_ARRAY() helper macro.

This helper allows for flexible-array members in unions.

---
 drivers/net/wireless/intel/ipw2x00/ipw2200.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/ipw2x00/ipw2200.h +1 -1
index 55cac934f4ee..09ddd21608d4 100644
@@ -651,7 +651,7 @@ struct ipw_rx_notification {
 		struct notif_link_deterioration link_deterioration;
 		struct notif_calibration calibration;
 		struct notif_noise noise;
-		u8 raw[0];
+		DECLARE_FLEX_ARRAY(u8, raw);
 	} u;
 } __packed;
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Gustavo A. R. Silva

Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations in anonymous union with the new DECLARE_FLEX_ARRAY() helper macro.

This helper allows for flexible-array members in unions.

Signature · 1 line
Kees Cook
#2 lore raw
In reply to Gustavo A. R. Silva
Quoted 5 lines · Gustavo A. R. Silva

Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations in anonymous union with the new DECLARE_FLEX_ARRAY() helper macro.

Quoted 7 lines

This helper allows for flexible-array members in unions.

Patch applied to wireless-next.git, thanks.

413cda95648d ipw2x00: Replace zero-length array with DECLARE_FLEX_ARRAY() helper

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/YzIeULWc17XSIglv@work/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches