702-v5.19-16-eth-mtk_eth_soc-silence-the-GCC-12-array-bounds-warn.patch 893 B

1234567891011121314151617181920212223242526
  1. From: Jakub Kicinski <[email protected]>
  2. Date: Fri, 20 May 2022 12:56:03 -0700
  3. Subject: [PATCH] eth: mtk_eth_soc: silence the GCC 12 array-bounds warning
  4. GCC 12 gets upset because in mtk_foe_entry_commit_subflow()
  5. this driver allocates a partial structure. The writes are
  6. within bounds.
  7. Silence these warnings for now, our build bot runs GCC 12
  8. so we won't allow any new instances.
  9. Signed-off-by: Jakub Kicinski <[email protected]>
  10. Signed-off-by: David S. Miller <[email protected]>
  11. ---
  12. --- a/drivers/net/ethernet/mediatek/Makefile
  13. +++ b/drivers/net/ethernet/mediatek/Makefile
  14. @@ -11,3 +11,8 @@ mtk_eth-$(CONFIG_NET_MEDIATEK_SOC_WED) +
  15. endif
  16. obj-$(CONFIG_NET_MEDIATEK_SOC_WED) += mtk_wed_ops.o
  17. obj-$(CONFIG_NET_MEDIATEK_STAR_EMAC) += mtk_star_emac.o
  18. +
  19. +# FIXME: temporarily silence -Warray-bounds on non W=1+ builds
  20. +ifndef KBUILD_EXTRA_WARN
  21. +CFLAGS_mtk_ppe.o += -Wno-array-bounds
  22. +endif