All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/3] eth: silence the GCC 12 array-bounds warnings
@ 2022-05-20 19:56 Jakub Kicinski
  2022-05-20 19:56 ` [PATCH net-next v2 1/3] eth: mtk_eth_soc: silence the GCC 12 array-bounds warning Jakub Kicinski
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jakub Kicinski @ 2022-05-20 19:56 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, Jakub Kicinski

Silence the array-bounds warnings in Ethernet drivers.
v2 uses -Wno-array-bounds directly.

Jakub Kicinski (3):
  eth: mtk_eth_soc: silence the GCC 12 array-bounds warning
  eth: ice: silence the GCC 12 array-bounds warning
  eth: tg3: silence the GCC 12 array-bounds warning

 drivers/net/ethernet/broadcom/Makefile  | 5 +++++
 drivers/net/ethernet/intel/ice/Makefile | 5 +++++
 drivers/net/ethernet/mediatek/Makefile  | 5 +++++
 3 files changed, 15 insertions(+)

-- 
2.34.3


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net-next v2 1/3] eth: mtk_eth_soc: silence the GCC 12 array-bounds warning
  2022-05-20 19:56 [PATCH net-next v2 0/3] eth: silence the GCC 12 array-bounds warnings Jakub Kicinski
@ 2022-05-20 19:56 ` Jakub Kicinski
  2022-05-20 19:56 ` [PATCH net-next v2 2/3] eth: ice: " Jakub Kicinski
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2022-05-20 19:56 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, Jakub Kicinski, nbd, john, sean.wang,
	Mark-MC.Lee, matthias.bgg

GCC 12 gets upset because in mtk_foe_entry_commit_subflow()
this driver allocates a partial structure. The writes are
within bounds.

Silence these warnings for now, our build bot runs GCC 12
so we won't allow any new instances.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: nbd@nbd.name
CC: john@phrozen.org
CC: sean.wang@mediatek.com
CC: Mark-MC.Lee@mediatek.com
CC: matthias.bgg@gmail.com
---
 drivers/net/ethernet/mediatek/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/mediatek/Makefile b/drivers/net/ethernet/mediatek/Makefile
index 45ba0970504a..fe66ba8793cf 100644
--- a/drivers/net/ethernet/mediatek/Makefile
+++ b/drivers/net/ethernet/mediatek/Makefile
@@ -11,3 +11,8 @@ mtk_eth-$(CONFIG_NET_MEDIATEK_SOC_WED) += mtk_wed_debugfs.o
 endif
 obj-$(CONFIG_NET_MEDIATEK_SOC_WED) += mtk_wed_ops.o
 obj-$(CONFIG_NET_MEDIATEK_STAR_EMAC) += mtk_star_emac.o
+
+# FIXME: temporarily silence -Warray-bounds on non W=1+ builds
+ifndef KBUILD_EXTRA_WARN
+CFLAGS_mtk_ppe.o += -Wno-array-bounds
+endif
-- 
2.34.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net-next v2 2/3] eth: ice: silence the GCC 12 array-bounds warning
  2022-05-20 19:56 [PATCH net-next v2 0/3] eth: silence the GCC 12 array-bounds warnings Jakub Kicinski
  2022-05-20 19:56 ` [PATCH net-next v2 1/3] eth: mtk_eth_soc: silence the GCC 12 array-bounds warning Jakub Kicinski
@ 2022-05-20 19:56 ` Jakub Kicinski
  2022-05-20 19:56 ` [PATCH net-next v2 3/3] eth: tg3: " Jakub Kicinski
  2022-05-22 21:30 ` [PATCH net-next v2 0/3] eth: silence the GCC 12 array-bounds warnings patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2022-05-20 19:56 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, Jakub Kicinski, jesse.brandeburg,
	anthony.l.nguyen

GCC 12 gets upset because driver allocates partial
struct ice_aqc_sw_rules_elem buffers. The writes are
within bounds.

Silence these warnings for now, our build bot runs GCC 12
so we won't allow any new instances.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: jesse.brandeburg@intel.com
CC: anthony.l.nguyen@intel.com
---
 drivers/net/ethernet/intel/ice/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/Makefile b/drivers/net/ethernet/intel/ice/Makefile
index 9183d480b70b..46f439641441 100644
--- a/drivers/net/ethernet/intel/ice/Makefile
+++ b/drivers/net/ethernet/intel/ice/Makefile
@@ -47,3 +47,8 @@ ice-$(CONFIG_DCB) += ice_dcb.o ice_dcb_nl.o ice_dcb_lib.o
 ice-$(CONFIG_RFS_ACCEL) += ice_arfs.o
 ice-$(CONFIG_XDP_SOCKETS) += ice_xsk.o
 ice-$(CONFIG_ICE_SWITCHDEV) += ice_eswitch.o
+
+# FIXME: temporarily silence -Warray-bounds on non W=1+ builds
+ifndef KBUILD_EXTRA_WARN
+CFLAGS_ice_switch.o += -Wno-array-bounds
+endif
-- 
2.34.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net-next v2 3/3] eth: tg3: silence the GCC 12 array-bounds warning
  2022-05-20 19:56 [PATCH net-next v2 0/3] eth: silence the GCC 12 array-bounds warnings Jakub Kicinski
  2022-05-20 19:56 ` [PATCH net-next v2 1/3] eth: mtk_eth_soc: silence the GCC 12 array-bounds warning Jakub Kicinski
  2022-05-20 19:56 ` [PATCH net-next v2 2/3] eth: ice: " Jakub Kicinski
@ 2022-05-20 19:56 ` Jakub Kicinski
  2022-05-22 21:30 ` [PATCH net-next v2 0/3] eth: silence the GCC 12 array-bounds warnings patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2022-05-20 19:56 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, Jakub Kicinski

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>
---
---
 drivers/net/ethernet/broadcom/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

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
-- 
2.34.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next v2 0/3] eth: silence the GCC 12 array-bounds warnings
  2022-05-20 19:56 [PATCH net-next v2 0/3] eth: silence the GCC 12 array-bounds warnings Jakub Kicinski
                   ` (2 preceding siblings ...)
  2022-05-20 19:56 ` [PATCH net-next v2 3/3] eth: tg3: " Jakub Kicinski
@ 2022-05-22 21:30 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-05-22 21:30 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni

Hello:

This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Fri, 20 May 2022 12:56:02 -0700 you wrote:
> Silence the array-bounds warnings in Ethernet drivers.
> v2 uses -Wno-array-bounds directly.
> 
> Jakub Kicinski (3):
>   eth: mtk_eth_soc: silence the GCC 12 array-bounds warning
>   eth: ice: silence the GCC 12 array-bounds warning
>   eth: tg3: silence the GCC 12 array-bounds warning
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/3] eth: mtk_eth_soc: silence the GCC 12 array-bounds warning
    https://git.kernel.org/netdev/net-next/c/06da3e8f390a
  - [net-next,v2,2/3] eth: ice: silence the GCC 12 array-bounds warning
    https://git.kernel.org/netdev/net-next/c/385bc51b41ea
  - [net-next,v2,3/3] eth: tg3: silence the GCC 12 array-bounds warning
    https://git.kernel.org/netdev/net-next/c/9dec850fd7c2

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-22 21:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-20 19:56 [PATCH net-next v2 0/3] eth: silence the GCC 12 array-bounds warnings Jakub Kicinski
2022-05-20 19:56 ` [PATCH net-next v2 1/3] eth: mtk_eth_soc: silence the GCC 12 array-bounds warning Jakub Kicinski
2022-05-20 19:56 ` [PATCH net-next v2 2/3] eth: ice: " Jakub Kicinski
2022-05-20 19:56 ` [PATCH net-next v2 3/3] eth: tg3: " Jakub Kicinski
2022-05-22 21:30 ` [PATCH net-next v2 0/3] eth: silence the GCC 12 array-bounds warnings patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.