1
linux/drivers/net/wireless/microchip/wilc1000
Gustavo A. R. Silva 57be3d3562 wifi: radiotap: Avoid -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.

So, in order to avoid ending up with a flexible-array member in the
middle of multiple other structs, we use the `__struct_group()`
helper to create a new tagged `struct ieee80211_radiotap_header_fixed`.
This structure groups together all the members of the flexible
`struct ieee80211_radiotap_header` except the flexible array.

As a result, the array is effectively separated from the rest of the
members without modifying the memory layout of the flexible structure.
We then change the type of the middle struct members currently causing
trouble from `struct ieee80211_radiotap_header` to `struct
ieee80211_radiotap_header_fixed`.

We also want to ensure that in case new members need to be added to the
flexible structure, they are always included within the newly created
tagged struct. For this, we use `static_assert()`. This ensures that the
memory layout for both the flexible structure and the new tagged struct
is the same after any changes.

This approach avoids having to implement `struct ieee80211_radiotap_header_fixed`
as a completely separate structure, thus preventing having to maintain
two independent but basically identical structures, closing the door
to potential bugs in the future.

So, with these changes, fix the following warnings:
drivers/net/wireless/ath/wil6210/txrx.c:309:50: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
drivers/net/wireless/intel/ipw2x00/ipw2100.c:2521:50: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
drivers/net/wireless/intel/ipw2x00/ipw2200.h:1146:42: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
drivers/net/wireless/intel/ipw2x00/libipw.h:595:36: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
drivers/net/wireless/marvell/libertas/radiotap.h:34:42: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
drivers/net/wireless/marvell/libertas/radiotap.h:5:42: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
drivers/net/wireless/microchip/wilc1000/mon.c:10:42: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
drivers/net/wireless/microchip/wilc1000/mon.c:15:42: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
drivers/net/wireless/virtual/mac80211_hwsim.c:758:42: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
drivers/net/wireless/virtual/mac80211_hwsim.c:767:42: 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/ZwBMtBZKcrzwU7l4@kspp
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-10-08 21:24:20 +02:00
..
cfg80211.c wifi: wilc1000: remove suspend/resume from cfg80211 part 2024-06-18 13:23:16 +03:00
cfg80211.h wifi: wilc1000: Remove unused declarations 2023-08-23 14:12:17 +03:00
fw.h wifi: wilc1000: add function to read mac address from eFuse 2024-05-17 11:01:51 +03:00
hif.c wifi: wilc1000: fix potential RCU dereference issue in wilc_parse_join_bss_param 2024-09-09 15:28:47 +03:00
hif.h wifi: wilc1000: set wilc_set_mac_address parameter as const 2024-05-17 11:01:51 +03:00
Kconfig wilc1000: Add support for enabling CRC 2021-04-17 20:47:40 +03:00
Makefile
mon.c wifi: radiotap: Avoid -Wflex-array-member-not-at-end warnings 2024-10-08 21:24:20 +02:00
netdev.c wireless-next patches for v6.11 2024-06-10 17:40:26 -07:00
netdev.h wifi: wilc1000: remove suspend/resume from cfg80211 part 2024-06-18 13:23:16 +03:00
sdio.c wifi: wilc1000: Convert using devm_clk_get_optional_enabled() in wilc_sdio_probe() 2024-09-09 15:30:04 +03:00
spi.c wifi: wilc1000: Convert using devm_clk_get_optional_enabled() in wilc_bus_probe() 2024-09-09 15:30:04 +03:00
wlan_cfg.c wifi: wilc1000: get correct length of string WID from received config packet 2022-07-27 15:58:10 +03:00
wlan_cfg.h wifi: wilc1000: Increase ASSOC response buffer 2023-05-11 15:53:44 +03:00
wlan_if.h wifi: wilc1000: Increase ASSOC response buffer 2023-05-11 15:53:44 +03:00
wlan.c wifi: wilc1000: let host->chip suspend/resume notifications manage chip wake/sleep 2024-06-18 13:23:15 +03:00
wlan.h wifi: wilc1000: disable power sequencer 2024-06-18 13:23:15 +03:00