[PATCH] sh_eth: disable -Woverride-init warning
From: Arnd Bergmann
Date: Wed Jun 08 2016 - 07:08:55 EST
-Woverride-init is part of a 'make W=1' build and it might be nice
to enable it in normal builds as it catches real bugs, but it
causes hundreds of identical false positive warnings in the sh_eth
driver:
ethernet/renesas/sh_eth.c:63:11: error: initialized field overwritten [-Werror=override-init]
ethernet/renesas/sh_eth.c:63:11: note: (near initialization for 'sh_eth_offset_gigabit[0]')
ethernet/renesas/sh_eth.c:64:11: error: initialized field overwritten [-Werror=override-init]
ethernet/renesas/sh_eth.c:64:11: note: (near initialization for 'sh_eth_offset_gigabit[1]')
ethernet/renesas/sh_eth.c:65:12: error: initialized field overwritten [-Werror=override-init]
ethernet/renesas/sh_eth.c:65:12: note: (near initialization for 'sh_eth_offset_gigabit[2]')
ethernet/renesas/sh_eth.c:66:12: error: initialized field overwritten [-Werror=override-init]
ethernet/renesas/sh_eth.c:66:12: note: (near initialization for 'sh_eth_offset_gigabit[3]')
ethernet/renesas/sh_eth.c:67:11: error: initialized field overwritten [-Werror=override-init]
ethernet/renesas/sh_eth.c:67:11: note: (near initialization for 'sh_eth_offset_gigabit[4]')
This turns off the particular warning for this file, overriding the
C flags.
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 45a7a6ba7644..1980cbcef066 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -57,6 +57,7 @@
#define SH_ETH_OFFSET_DEFAULTS \
[0 ... SH_ETH_MAX_REGISTER_OFFSET - 1] = SH_ETH_OFFSET_INVALID
+#pragma GCC diagnostic ignored "-Woverride-init"
static const u16 sh_eth_offset_gigabit[SH_ETH_MAX_REGISTER_OFFSET] = {
SH_ETH_OFFSET_DEFAULTS,