ath9k: work around false-positive gcc warning
authorArnd Bergmann <arnd@arndb.de>
Sat, 7 Nov 2020 08:16:27 +0000 (10:16 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 10 Nov 2020 18:12:42 +0000 (20:12 +0200)
commitb96fab4e36023ee37ed1aad331ddd11b77c46c42
treeb6a8145b3a158af758f0ccc5b44089213c3a7dd0
parentfa7572c2cfe081dff82f884fa05f1b067d4beaaa
ath9k: work around false-positive gcc warning

gcc-10 shows a false-positive warning with CONFIG_KASAN:

drivers/net/wireless/ath/ath9k/dynack.c: In function 'ath_dynack_sample_tx_ts':
include/linux/etherdevice.h:290:14: warning: writing 4 bytes into a region of size 0 [-Wstringop-overflow=]
  290 |  *(u32 *)dst = *(const u32 *)src;
      |  ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~

Until gcc is fixed, work around this by using memcpy() in place
of ether_addr_copy(). Hopefully gcc-11 will not have this problem.

Link: https://godbolt.org/z/sab1MK
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97490
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
[kvalo@codeaurora.org: remove ifdef and add a comment]
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20201026213040.3889546-8-arnd@kernel.org
drivers/net/wireless/ath/ath9k/dynack.c