diff options
author | Jakub Kicinski <kuba@kernel.org> | 2022-05-20 21:56:05 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-05-22 23:21:11 +0200 |
commit | 9dec850fd7c210a04b4707df8e6c95bfafdd6a4b (patch) | |
tree | dc62dabe25feba498f78a3bc85f57d0cfaa7e0fe | |
parent | eth: ice: silence the GCC 12 array-bounds warning (diff) | |
download | linux-9dec850fd7c210a04b4707df8e6c95bfafdd6a4b.tar.xz linux-9dec850fd7c210a04b4707df8e6c95bfafdd6a4b.zip |
eth: tg3: silence the GCC 12 array-bounds warning
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>
-rw-r--r-- | drivers/net/ethernet/broadcom/Makefile | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/Makefile b/drivers/net/ethernet/broadcom/Makefile index 0ddfb5b5d53c..2e6c5f258a1f 100644 --- a/drivers/net/ethernet/broadcom/Makefile +++ b/drivers/net/ethernet/broadcom/Makefile @@ -17,3 +17,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 |