mac80211: ath: add struct_group for struct ath_cycle_counters
authorShiji Yang <yangshiji66@qq.com>
Sat, 27 May 2023 09:18:50 +0000 (17:18 +0800)
committerDavid Bauer <mail@david-bauer.net>
Tue, 31 Oct 2023 20:12:15 +0000 (21:12 +0100)
commit2d314984b1cf87baf497b1161fed480dc9947f1c
tree4c6fcff578083aaa3600119f04e63c6acd5a6b6d
parentc997634c017294cb38cf6f9a0112860c7e736a53
mac80211: ath: add struct_group for struct ath_cycle_counters

Add a struct_group to around all members in struct ath_cycle_counters.
It can help the compiler detect the intended bounds of the memcpy() and
memset().

This patch fixes the following build warning:

In function 'fortify_memset_chk',
    inlined from 'ath9k_ps_wakeup' at /home/db/openwrt/build_dir/target-mips_24kc_musl/linux-ath79_generic/backports-6.1.24/drivers/net/wireless/ath/ath9k/main.c:140:3:
./include/linux/fortify-string.h:314: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]
  314 |                         __write_overflow_field(p_size_field, size);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
package/kernel/mac80211/patches/ath/100-wifi-ath-add-struct_group-for-struct-ath_cycle_count.patch [new file with mode: 0644]