summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-05-20 21:43:20 +0200
committerJakub Kicinski <kuba@kernel.org>2022-05-23 02:23:15 +0200
commit13182526173679c3be794c8149226fc258fdfdbe (patch)
tree8a459b2cc54cd5a169a0daec3123ac0356a5f9c6 /drivers/net/wireless/ath
parentwifi: brcmfmac: work around a GCC 12 -Warray-bounds warning (diff)
downloadlinux-13182526173679c3be794c8149226fc258fdfdbe.tar.xz
linux-13182526173679c3be794c8149226fc258fdfdbe.zip
wifi: carl9170: silence a GCC 12 -Warray-bounds warning
carl9170 has a big union (struct carl9170_cmd) with all the command types in it. But it allocates buffers only large enough for a given command. This upsets GCC 12: drivers/net/wireless/ath/carl9170/cmd.c:125:30: warning: array subscript ‘struct carl9170_cmd[0]’ is partly outside array bounds of ‘unsigned char[8]’ [-Warray-bounds] 125 | tmp->hdr.cmd = cmd; | ~~~~~~~~~~~~~^~~~~ Punt the warning to W=1 for now. Hopefully GCC will learn to recognize which fields are in-bounds. Acked-by: Christian Lamparter <chunkeey@gmail.com> Acked-by: Kalle Valo <kvalo@kernel.org> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/carl9170/Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/carl9170/Makefile b/drivers/net/wireless/ath/carl9170/Makefile
index 1a81868ce26d..7463baa62fa8 100644
--- a/drivers/net/wireless/ath/carl9170/Makefile
+++ b/drivers/net/wireless/ath/carl9170/Makefile
@@ -3,3 +3,8 @@ carl9170-objs := main.o usb.o cmd.o mac.o phy.o led.o fw.o tx.o rx.o
carl9170-$(CONFIG_CARL9170_DEBUGFS) += debug.o
obj-$(CONFIG_CARL9170) += carl9170.o
+
+# FIXME: temporarily silence -Warray-bounds on non W=1+ builds
+ifndef KBUILD_EXTRA_WARN
+CFLAGS_cmd.o += -Wno-array-bounds
+endif