summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/broadcom/Makefile
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-05-20 22:56:05 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-09 11:20:56 +0300
commit340cf91293a3e6477daef1d883ace10c327d7cc9 (patch)
tree75fe76f5784124c7d41cb8e6c850311c525e32c1 /drivers/net/ethernet/broadcom/Makefile
parentcb2ca93f8fe350e89e2623b9966f6940ee587c1e (diff)
downloadlinux-340cf91293a3e6477daef1d883ace10c327d7cc9.tar.xz
eth: tg3: silence the GCC 12 array-bounds warning
[ Upstream commit 9dec850fd7c210a04b4707df8e6c95bfafdd6a4b ] GCC 12 currently generates a rather inconsistent warning: drivers/net/ethernet/broadcom/tg3.c:17795:51: warning: array subscript 5 is above array bounds of ‘struct tg3_napi[5]’ [-Warray-bounds] 17795 | struct tg3_napi *tnapi = &tp->napi[i]; | ~~~~~~~~^~~ i is guaranteed < tp->irq_max which in turn is either 1 or 5. There are more loops like this one in the driver, but strangely GCC 12 dislikes only this single one. Silence this silliness for now. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/broadcom/Makefile')
-rw-r--r--drivers/net/ethernet/broadcom/Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/Makefile b/drivers/net/ethernet/broadcom/Makefile
index 7046ad6d3d0e..ac50da49ca77 100644
--- a/drivers/net/ethernet/broadcom/Makefile
+++ b/drivers/net/ethernet/broadcom/Makefile
@@ -16,3 +16,8 @@ obj-$(CONFIG_BGMAC_BCMA) += bgmac-bcma.o bgmac-bcma-mdio.o
obj-$(CONFIG_BGMAC_PLATFORM) += bgmac-platform.o
obj-$(CONFIG_SYSTEMPORT) += bcmsysport.o
obj-$(CONFIG_BNXT) += bnxt/
+
+# FIXME: temporarily silence -Warray-bounds on non W=1+ builds
+ifndef KBUILD_EXTRA_WARN
+CFLAGS_tg3.o += -Wno-array-bounds
+endif