Skip to contentSkip to conversation

brcmfmac: Replace one-element array with flexible-array member

PATCH In review Gustavo A. R. Silva 3 participants 3 messages Feb 3, 2023 – Feb 13, 2023

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

PATCH 1/1 brcmfmac: Replace one-element array with flexible-array member

One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct brcmf_tlv.

This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1].

This results in no differences in binary output.

---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +1 -1
index e90a30808c22..0e1fa3f0dea2 100644
@@ -383,7 +383,7 @@ struct brcmf_cfg80211_info {
 struct brcmf_tlv {
 	u8 id;
 	u8 len;
-	u8 data[1];
+	u8 data[];
 };
 
 static inline struct wiphy *cfg_to_wiphy(struct brcmf_cfg80211_info *cfg)
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Gustavo A. R. Silva

One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct brcmf_tlv.

This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1].

Quoted 6 lines

This results in no differences in binary output.

Signature · 1 line
Kees Cook
#2 lore raw

Re: [next] wifi: brcmfmac: Replace one-element array with flexible-array member

In reply to Gustavo A. R. Silva
Quoted 8 lines · Gustavo A. R. Silva

One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct brcmf_tlv.

This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines on memcpy() and help us make progress towards globally enabling -fstrict-flex-arrays=3 [1].

Quoted 7 lines

This results in no differences in binary output.

Patch applied to wireless-next.git, thanks.

552ac55ee9bc wifi: brcmfmac: Replace one-element array with flexible-array member

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

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