1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet
Nathan Chancellor b74ef9f9cb net: sparx5: Do not use mac_addr uninitialized in mchp_sparx5_probe()
Clang warns:

drivers/net/ethernet/microchip/sparx5/sparx5_main.c:760:29: warning:
variable 'mac_addr' is uninitialized when used here [-Wuninitialized]
        if (of_get_mac_address(np, mac_addr)) {
                                   ^~~~~~~~
drivers/net/ethernet/microchip/sparx5/sparx5_main.c:669:14: note:
initialize the variable 'mac_addr' to silence this warning
        u8 *mac_addr;
                    ^
                     = NULL
1 warning generated.

mac_addr is only used to store the value retrieved from
of_get_mac_address(), which is then copied into the base_mac member of
the sparx5 struct using ether_addr_copy(). It is easier to just use the
base_mac address directly, which avoids the warning and the extra copy.

Fixes: 3cfa11bac9 ("net: sparx5: add the basic sparx5 driver")
Link: https://github.com/ClangBuiltLinux/linux/issues/1413
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-06-28 15:50:21 -07:00
..
3com net: 3com: remove leading spaces before tabs 2021-05-19 12:17:30 -07:00
8390 net: 8390: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
actions net: ethernet: actions: Add Actions Semi Owl Ethernet MAC driver 2021-03-22 12:56:21 -07:00
adaptec treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
aeroflex of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
agere ethernet: select CONFIG_CRC32 as needed 2020-12-04 14:42:21 -08:00
alacritech
allwinner of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
alteon net: alteon: remove leading spaces before tabs 2021-05-19 12:17:30 -07:00
altera of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
amazon Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-06-28 15:28:03 -07:00
amd net: amd: remove leading spaces before tabs 2021-05-19 12:17:30 -07:00
apm
apple net: apple: remove leading spaces before tabs 2021-05-19 12:17:30 -07:00
aquantia net: ethernet: aquantia: Handle error cleanup of start on open 2021-02-11 14:38:06 -08:00
arc net: arc: Demote non-compliant kernel-doc headers 2021-05-17 14:12:38 -07:00
atheros Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-18 19:47:02 -07:00
broadcom Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-06-28 15:28:03 -07:00
brocade net: brocade: bna: Fix wrong function name in comments 2021-05-17 14:12:38 -07:00
cadence net: macb: Use devm_platform_get_and_ioremap_resource() 2021-06-07 14:07:22 -07:00
calxeda net: calxeda: Fix wrong function name in comments 2021-05-17 14:12:38 -07:00
cavium thunderx: Remove rcu_read_lock() around XDP program invocation 2021-06-24 19:44:02 +02:00
chelsio Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-18 19:47:02 -07:00
cirrus
cisco ethernet:enic: Fix a use after free bug in enic_hard_start_xmit 2021-05-03 13:23:00 -07:00
cortina net: gemini: Use devm_platform_get_and_ioremap_resource() 2021-06-07 13:20:00 -07:00
davicom net: davicom: Remove redundant assignment to ret 2021-04-26 12:48:30 -07:00
dec net: tulip: Remove the repeated declaration 2021-06-07 14:03:11 -07:00
dlink net: dlink: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
emulex be2net: Fix an error handling path in 'be_probe()' 2021-06-17 11:24:06 -07:00
ezchip of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
faraday net: ftgmac100: add missing error return code in ftgmac100_probe() 2021-05-23 16:16:24 -07:00
freescale Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-06-28 15:28:03 -07:00
fujitsu Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-05-27 09:55:10 -07:00
google gve: Fix warnings reported for DQO patchset 2021-06-24 15:38:29 -07:00
hisilicon net: hns3: add support for dumping MAC umv counter in debugfs 2021-06-28 13:34:58 -07:00
huawei net: huawei: hinic: Fix wrong function name in comments 2021-05-17 14:12:38 -07:00
i825xx drivers: net: ethernet: i825xx: Fix couple of spellings in the file ether1.c 2021-02-04 19:07:55 -08:00
ibm ibmveth: Set CHECKSUM_PARTIAL if NULL TCP CSUM. 2021-06-23 12:54:11 -07:00
intel Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-06-28 15:28:03 -07:00
marvell Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-06-28 15:28:03 -07:00
mediatek net: ethernet: mtk_eth_soc: Fix packet statistics support for MT7628/88 2021-05-23 16:13:11 -07:00
mellanox Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-06-28 15:28:03 -07:00
micrel net: phy: micrel: move phy reg offsets to common header 2021-06-14 12:54:43 -07:00
microchip net: sparx5: Do not use mac_addr uninitialized in mchp_sparx5_probe() 2021-06-28 15:50:21 -07:00
microsoft net: mana: Use struct_size() in kzalloc() 2021-05-13 15:58:46 -07:00
moxa net: moxa: Use devm_platform_get_and_ioremap_resource() 2021-06-07 14:08:30 -07:00
mscc net: bridge: allow the switchdev replay functions to be called for deletion 2021-06-28 14:09:03 -07:00
myricom ethernet: myri10ge: Fix missing error code in myri10ge_probe() 2021-06-01 15:54:38 -07:00
natsemi net: natsemi: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
neterion net: neterion: vxge: remove redundant continue statement 2021-06-18 11:29:40 -07:00
netronome Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-06-28 15:28:03 -07:00
ni net: nixge: simplify code with devm platform functions 2021-06-08 16:36:57 -07:00
nvidia forcedeth: fix excluded_middle.cocci warnings 2020-11-03 17:47:04 -08:00
nxp of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
oki-semi net: pch_gbe: remove unneeded MODULE_VERSION() call 2021-05-10 14:58:20 -07:00
packetengines drivers/net/ethernet: clean up mis-targeted comments 2020-09-25 16:29:00 -07:00
pasemi net: pasemi: fix error return code in pasemi_mac_open() 2020-12-02 18:03:58 -08:00
pensando ionic: fix ptp support config breakage 2021-05-11 16:20:27 -07:00
qlogic Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-06-28 15:28:03 -07:00
qualcomm net: qualcomm: rmnet: fix two pointer math bugs 2021-06-21 12:19:19 -07:00
rdc net: r6040: Allow restarting auto-negotiation 2021-05-23 17:23:59 -07:00
realtek Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-18 19:47:02 -07:00
renesas Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-18 19:47:02 -07:00
rocker net: bridge: switchdev: include local flag in FDB notifications 2021-04-16 15:15:45 -07:00
samsung net: samsung: sxgbe: Fix wrong function name in comments 2021-05-17 14:12:39 -07:00
seeq net: seeq: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
sfc sfc: Remove rcu_read_lock() around XDP program invocation 2021-06-24 19:46:01 +02:00
sgi net: sgi: ioc3-eth: check return value after calling platform_get_resource() 2021-06-09 15:24:43 -07:00
silan net: silan: convert tasklets to use new tasklet_setup() API 2020-09-14 13:02:38 -07:00
sis net: sis: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
smsc net: smsc: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
socionext netsec: Remove rcu_read_lock() around XDP program invocation 2021-06-24 19:46:12 +02:00
stmicro Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-06-28 15:28:03 -07:00
sun Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-05-27 09:55:10 -07:00
synopsys net: dwc-xlgmac: Fix spelling mistake in function name 2021-02-06 11:37:01 -08:00
tehuti net: tehuti: fix error return code in bdx_probe() 2021-03-05 12:59:32 -08:00
ti Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-06-28 15:28:03 -07:00
toshiba net: toshiba: fix the trailing format of some block comments 2021-03-31 14:34:09 -07:00
tundra
via net: via: Fix wrong function name in comments 2021-05-17 14:12:39 -07:00
wiznet net: w5100: Use devm_platform_get_and_ioremap_resource() 2021-06-10 13:53:13 -07:00
xilinx net: ll_temac: Remove left-over debug message 2021-06-21 14:44:09 -07:00
xircom net: xircom: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
xscale net: ethernet: ixp4xx_eth: Use devm_platform_get_and_ioremap_resource() 2021-06-07 13:05:37 -07:00
dnet.c drivers/net/ethernet: clean up unused assignments 2020-09-25 16:29:00 -07:00
dnet.h
ec_bhf.c net: ethernet: fix potential use-after-free in ec_bhf_remove 2021-06-18 13:01:17 -07:00
ethoc.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
fealnx.c net: fealnx: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
jme.c net: jme: Replace link-change tasklet with work 2021-03-17 16:33:58 +01:00
jme.h net: jme: Replace link-change tasklet with work 2021-03-17 16:33:58 +01:00
Kconfig net: korina: Make driver COMPILE_TESTable 2021-04-19 15:58:14 -07:00
korina.c net: korina: Fix return value check in korina_probe() 2021-05-13 15:54:08 -07:00
lantiq_etop.c
lantiq_xrx200.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-18 19:47:02 -07:00
Makefile net: mana: Add a driver for Microsoft Azure Network Adapter (MANA) 2021-04-19 15:24:25 -07:00