diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2020-09-25 15:24:41 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-25 16:29:00 -0700 |
commit | 2602ddfe1929bfebfc2862400bd3bfd6f310b9bb (patch) | |
tree | 1f47f16f5ba8f21fa6fe51c564011bc262bdb0c3 /drivers/video | |
parent | 553aca1cd5fa411a21f9601ed5dd744d5ffd5439 (diff) |
drivers/net/ethernet: handle one warning explicitly
While fixing the W=1 builds, this warning came up because the
developers used a very tricky way to get structures initialized
to a non-zero value, but this causes GCC to warn about an
override. In this case the override was intentional, so just
disable the warning for this code with a kernel macro that results
in disabling the warning for compiles on GCC versions after 8.
It is not appropriate to change the struct to initialize all the
values as it will just add a lot more code for no value. The code
is completely correct as is, we just want to acknowledge that
this code could generate a warning and we're ok with that.
NOTE: the __diag_ignore macro currently only accepts a second
argument of 8 (version 80000), it's either use this one or
open code the pragma.
Fixed Warnings example (all the same):
drivers/net/ethernet/renesas/sh_eth.c:51:12: warning: initialized field overwritten [-Woverride-init]
drivers/net/ethernet/renesas/sh_eth.c:52:12: warning: initialized field overwritten [-Woverride-init]
drivers/net/ethernet/renesas/sh_eth.c:53:13: warning: initialized field overwritten [-Woverride-init]
+ 256 more...
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/video')
0 files changed, 0 insertions, 0 deletions