1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net
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
..
appletalk
arcnet
bonding net: bonding: Use per-cpu rr_tx_counter 2021-06-15 11:26:15 -07:00
caif Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-18 19:47:02 -07:00
can Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-18 19:47:02 -07:00
dsa net: dsa: sja1105: fix dynamic access to L2 Address Lookup table for SJA1110 2021-06-28 15:49:05 -07:00
ethernet net: sparx5: Do not use mac_addr uninitialized in mchp_sparx5_probe() 2021-06-28 15:50:21 -07:00
fddi
fjes fjes: check return value after calling platform_get_resource() 2021-06-10 13:53:13 -07:00
hamradio Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-18 19:47:02 -07:00
hippi
hyperv hv_netvsc: Avoid field-overflowing memcpy() 2021-06-22 10:20:51 -07:00
ieee802154 Merge tag 'ieee802154-for-davem-2021-06-03' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan 2021-06-03 15:21:58 -07:00
ipa net: ipa: add IPA v3.1 configuration data 2021-06-21 12:31:00 -07:00
ipvlan
mdio net: mdiobus: withdraw fwnode_mdbiobus_register 2021-06-25 11:46:29 -07:00
mhi wwan: core: add WWAN common private data for netdev 2021-06-22 10:01:17 -07:00
netdevsim drivers: net: netdevsim: fix devlink_trap selftests failing 2021-06-18 11:28:27 -07:00
pcs net: pcs: xpcs: Fix a less than zero u16 comparison error 2021-06-17 11:14:06 -07:00
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-18 19:47:02 -07:00
plip
ppp
slip
team
usb usbnet: add usbnet_event_names[] for kevent 2021-06-24 12:34:45 -07:00
vmxnet3
wan net: c101: remove redundant spaces 2021-06-21 12:37:28 -07:00
wireguard wireguard: allowedips: free empty intermediate nodes when removing single node 2021-06-04 14:25:14 -07:00
wireless Lots of changes: 2021-06-28 13:06:12 -07:00
wwan wwan: core: add WWAN common private data for netdev 2021-06-22 10:01:17 -07:00
xen-netback xen-netback: take a reference to the RX task thread 2021-06-07 15:13:15 +02:00
bareudp.c bareudp: allow redirecting bareudp packets to eth devices 2021-06-28 12:44:17 -07:00
dummy.c
eql.c
geneve.c
gtp.c gtp: reset mac_header after decap 2021-06-28 12:44:17 -07:00
ifb.c
Kconfig net: wwan: Fix WWAN config symbols 2021-06-14 13:17:10 -07:00
LICENSE.SRC
loopback.c
macsec.c
macvlan.c macvlan: Fix a typo 2021-06-01 17:05:04 -07:00
macvtap.c
Makefile
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c
veth.c
virtio_net.c virtio_net: Use virtio_find_vqs_ctx() helper 2021-06-23 13:52:22 -07:00
vrf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-06-18 19:47:02 -07:00
vsockmon.c
vxlan.c
xen-netfront.c