summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/e1000e/netdev.c
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2019-02-21 20:09:29 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-05 22:34:31 +0200
commitcae3c93ad96b7e25817563d8c7c969de074a0ebb (patch)
tree2e89251db502555386eb6d042d56a7f67f0a8a80 /drivers/net/ethernet/intel/e1000e/netdev.c
parentdd8ab7cdbcda54e49a9d466e6c7fbed54a288762 (diff)
downloadblackbird-obmc-linux-cae3c93ad96b7e25817563d8c7c969de074a0ebb.tar.gz
blackbird-obmc-linux-cae3c93ad96b7e25817563d8c7c969de074a0ebb.zip
veth: Fix -Wformat-truncation
[ Upstream commit abdf47aab4123ece48877cab4153db44fe4dc340 ] Provide a precision hint to snprintf() in order to eliminate a -Wformat-truncation warning provided below. A maximum of 11 characters is allowed to reach a maximum of 32 - 1 characters given a possible maximum value of queues using up to UINT_MAX which occupies 10 characters. Incidentally 11 is the number of characters for "xdp_packets" which is the largest string we append. drivers/net/veth.c: In function 'veth_get_strings': drivers/net/veth.c:118:47: warning: '%s' directive output may be truncated writing up to 31 bytes into a region of size between 12 and 21 [-Wformat-truncation=] snprintf(p, ETH_GSTRING_LEN, "rx_queue_%u_%s", ^~ drivers/net/veth.c:118:5: note: 'snprintf' output between 12 and 52 bytes into a destination of size 32 snprintf(p, ETH_GSTRING_LEN, "rx_queue_%u_%s", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ i, veth_rq_stats_desc[j].desc); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/intel/e1000e/netdev.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud