summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2021-03-23 15:53:29 +0300
committerDavid S. Miller <davem@davemloft.net>2021-03-25 01:14:15 +0300
commitb7fbc88692e60a4955ac54af0bcf7f2162761339 (patch)
tree0f501bfdb670ef5a8db212748476a8b385922ffb /include
parent341f67e424e572bfc034daa534c6fa667533e6a4 (diff)
downloadlinux-b7fbc88692e60a4955ac54af0bcf7f2162761339.tar.xz
octeontx2: fix -Wnonnull warning
When compile testing this driver on a platform on which probe() is known to fail at compile time, gcc warns about the cgx_lmactype_string[] array being uninitialized: In function 'strncpy', inlined from 'link_status_user_format' at /git/arm-soc/drivers/net/ethernet/marvell/octeontx2/af/cgx.c:838:2, inlined from 'cgx_link_change_handler' at /git/arm-soc/drivers/net/ethernet/marvell/octeontx2/af/cgx.c:853:2: include/linux/fortify-string.h:27:30: error: argument 2 null where non-null expected [-Werror=nonnull] 27 | #define __underlying_strncpy __builtin_strncpy Address this by turning the runtime initialization into a fixed array, which should also produce better code. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Sunil Goutham <sgoutham@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions