linux_dsm_epyc7002/drivers/net/ethernet
Arnd Bergmann 3ded9f2b35 net: ethernet: freescale: fix false-positive string overflow warning
While compile-testing on arm64 with gcc-8.1, I ran into a build diagnostic:

drivers/net/ethernet/freescale/fec_main.c: In function 'fec_probe':
drivers/net/ethernet/freescale/fec_main.c:3517:25: error: '%d' directive writing between 1 and 10 bytes into a region of size 5 [-Werror=format-overflow=]
   sprintf(irq_name, "int%d", i);
                         ^~
drivers/net/ethernet/freescale/fec_main.c:3517:21: note: directive argument in the range [0, 2147483646]
   sprintf(irq_name, "int%d", i);
                     ^~~~~~~
drivers/net/ethernet/freescale/fec_main.c:3517:3: note: 'sprintf' output between 5 and 14 bytes into a destination of size 8
   sprintf(irq_name, "int%d", i);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It appears this has never shown on ppc32 or arm32 for an unknown reason, but
now gcc fails to identify that the 'irq_cnt' loop index has an upper bound
of 3, and instead uses a bogus range.

To work around the warning, this changes the sprintf to snprintf with the
correct buffer length.

Fixes: 78cc6e7ef9 ("net: ethernet: freescale: Allow FEC with COMPILE_TEST")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-05-30 13:16:44 -04:00
..
3com Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-05-21 16:01:54 -04:00
8390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-05-21 16:01:54 -04:00
adaptec
aeroflex
agere
alacritech
allwinner
alteon
altera ethernet: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
amazon net: ena: Eliminate duplicate barriers on weakly-ordered archs 2018-03-26 12:47:56 -04:00
amd Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-05-26 19:46:15 -04:00
apm
apple
aquantia net: aquantia: Limit number of vectors to actually allocated irqs 2018-05-08 00:06:44 -04:00
arc
atheros
aurora
broadcom bnx2x: Collect the device debug information during Tx timeout. 2018-05-28 22:52:52 -04:00
brocade ethernet: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
cadence drivers: net: Remove device_node checks with of_mdiobus_register() 2018-05-16 14:20:36 -04:00
calxeda
cavium liquidio: bump up driver version to 1.7.2 to match newer NIC firmware 2018-05-10 17:32:18 -04:00
chelsio cxgb4/cxgb4vf: Notify link changes to OS-dependent code 2018-05-25 15:10:07 -04:00
cirrus
cisco enic: set DMA mask to 47 bit 2018-05-24 23:05:30 -04:00
cortina
davicom treewide: simplify Kconfig dependencies for removed archs 2018-03-26 15:55:57 +02:00
dec
dlink
emulex ethernet: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
ezchip
faraday
freescale net: ethernet: freescale: fix false-positive string overflow warning 2018-05-30 13:16:44 -04:00
fujitsu
hisilicon net: hns3: Fixes initalization of RoCE handle and makes it conditional 2018-05-29 00:04:27 -04:00
hp
huawei net-next/hinic: add pci device ids for 25ge and 100ge card 2018-05-08 00:07:42 -04:00
i825xx
ibm Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-05-26 19:46:15 -04:00
intel Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2018-05-24 22:20:51 -04:00
marvell net: mvpp2: Add missing VLAN tag detection 2018-05-19 22:55:32 -04:00
mediatek net: mediatek: use of_device_get_match_data() 2018-04-16 13:43:07 -04:00
mellanox mlxsw: pci: Utilize MRSR register to perform FW reset 2018-05-29 10:10:03 -04:00
micrel
microchip
moxa
mscc net: mscc: Add SPDX identifier 2018-05-18 11:30:25 -04:00
myricom ethernet: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
natsemi Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-03-23 11:31:58 -04:00
neterion net: vxge: fix spelling mistake in macro VXGE_HW_ERR_PRIVILAGED_OPEARATION 2018-05-23 14:50:02 -04:00
netronome nfp: abm: report correct MQ stats 2018-05-29 09:49:17 -04:00
ni net: nixge: Address compiler warnings about signedness 2018-05-07 23:30:03 -04:00
nuvoton
nvidia
nxp
oki-semi
packetengines
pasemi
qlogic Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-05-26 19:46:15 -04:00
qualcomm net: qcom/emac: fix device tree initialization 2018-05-29 10:06:15 -04:00
rdc
realtek 8139too: Remove unnecessary netif_napi_del() 2018-05-25 16:35:45 -04:00
renesas Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-05-21 16:01:54 -04:00
rocker rocker: Postpone filtering of !added_by_user FDB 2018-05-10 17:54:57 -04:00
samsung ethernet: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
seeq
sfc sfc: stop the TX queue before pushing new buffers 2018-05-25 14:49:37 -04:00
sgi
silan
sis
smsc arch: remove obsolete architecture ports 2018-04-02 20:20:12 -07:00
socionext net: ethernet: ave: add support for phy-mode setting of system controller 2018-04-20 10:49:41 -04:00
stmicro net: stmmac: add dwmac-4.20a compatible 2018-05-28 23:08:29 -04:00
sun net: ethernet: sun: niu set correct packet size in skb 2018-05-04 13:20:46 -04:00
synopsys
tehuti
ti ti: ethernet: davinci: Fix cast to int warnings 2018-05-21 16:17:10 -04:00
toshiba
tundra
via
wiznet
xilinx
xircom
xscale
dnet.c
dnet.h
ec_bhf.c ethernet: Use octal not symbolic permissions 2018-03-26 12:07:49 -04:00
ethoc.c net: ethoc: Remove useless test before clk_disable_unprepare 2018-05-16 14:44:29 -04:00
fealnx.c
jme.c
jme.h
Kconfig net: ethernet: Sort Kconfig sourcing alphabetically 2018-05-21 12:14:47 -04:00
korina.c
lantiq_etop.c
Makefile net: mscc: Add initial Ocelot switch support 2018-05-15 16:41:15 -04:00
netx-eth.c