drop_monitor: work around gcc-10 stringop-overflow warning
authorArnd Bergmann <arnd@arndb.de>
Thu, 30 Apr 2020 21:30:49 +0000 (23:30 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 May 2020 22:45:16 +0000 (15:45 -0700)
commitdc30b4059f6e2abf3712ab537c8718562b21c45d
tree54aa52b437c67559860d908d63701bbacbb65278
parent846c68f7f1ac82c797a2f1db3344a2966c0fe2e1
drop_monitor: work around gcc-10 stringop-overflow warning

The current gcc-10 snapshot produces a false-positive warning:

net/core/drop_monitor.c: In function 'trace_drop_common.constprop':
cc1: error: writing 8 bytes into a region of size 0 [-Werror=stringop-overflow=]
In file included from net/core/drop_monitor.c:23:
include/uapi/linux/net_dropmon.h:36:8: note: at offset 0 to object 'entries' with size 4 declared here
   36 |  __u32 entries;
      |        ^~~~~~~

I reported this in the gcc bugzilla, but in case it does not get
fixed in the release, work around it by using a temporary variable.

Fixes: 9a8afc8d3962 ("Network Drop Monitor: Adding drop monitor implementation & Netlink protocol")
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94881
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/drop_monitor.c