kernel_samsung_a53x/drivers/net/wireless/ath/ath9k
Arnd Bergmann bf7565882a wifi: ath9k: work around memset overflow warning
[ Upstream commit 61752ac69b69ed2e04444d090f6917c77ab36d42 ]

gcc-9 and some other older versions produce a false-positive warning
for zeroing two fields

In file included from include/linux/string.h:369,
                 from drivers/net/wireless/ath/ath9k/main.c:18:
In function 'fortify_memset_chk',
    inlined from 'ath9k_ps_wakeup' at drivers/net/wireless/ath/ath9k/main.c:140:3:
include/linux/fortify-string.h:462:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
  462 |                         __write_overflow_field(p_size_field, size);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Using a struct_group seems to reliably avoid the warning and
not make the code much uglier. The combined memset() should even
save a couple of cpu cycles.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://msgid.link/20240328135509.3755090-3-arnd@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 14:19:06 +01:00
..
ahb.c
ani.c
ani.h
antenna.c
ar953x_initvals.h
ar955x_1p0_initvals.h
ar956x_initvals.h
ar5008_initvals.h
ar5008_phy.c
ar9001_initvals.h
ar9002_calib.c
ar9002_hw.c
ar9002_initvals.h
ar9002_mac.c
ar9002_phy.c
ar9002_phy.h
ar9003_2p2_initvals.h
ar9003_aic.c
ar9003_aic.h
ar9003_buffalo_initvals.h
ar9003_calib.c
ar9003_eeprom.c
ar9003_eeprom.h
ar9003_hw.c
ar9003_mac.c
ar9003_mac.h
ar9003_mci.c
ar9003_mci.h
ar9003_paprd.c
ar9003_phy.c
ar9003_phy.h
ar9003_rtt.c
ar9003_rtt.h
ar9003_wow.c
ar9330_1p1_initvals.h
ar9330_1p2_initvals.h
ar9340_initvals.h
ar9462_2p0_initvals.h
ar9462_2p1_initvals.h
ar9485_initvals.h
ar9565_1p0_initvals.h
ar9565_1p1_initvals.h
ar9580_1p0_initvals.h
ath9k.h
ath9k_pci_owl_loader.c
beacon.c
btcoex.c
btcoex.h
calib.c
calib.h
channel.c
common-beacon.c
common-beacon.h
common-debug.c
common-debug.h
common-init.c
common-init.h
common-spectral.c
common-spectral.h
common.c
common.h
debug.c
debug.h
debug_sta.c
dfs.c
dfs.h
dfs_debug.c
dfs_debug.h
dynack.c
dynack.h
eeprom.c
eeprom.h
eeprom_4k.c
eeprom_9287.c
eeprom_def.c
gpio.c
hif_usb.c
hif_usb.h
htc.h
htc_drv_beacon.c
htc_drv_debug.c
htc_drv_gpio.c
htc_drv_init.c
htc_drv_main.c
htc_drv_txrx.c
htc_hst.c
htc_hst.h
hw-ops.h
hw.c
hw.h
init.c
Kconfig
link.c
mac.c
mac.h
main.c
Makefile
mci.c
mci.h
pci.c
phy.h
recv.c
reg.h
reg_aic.h
reg_mci.h
reg_wow.h
rng.c
tx99.c
wmi.c
wmi.h
wow.c
xmit.c