linux/drivers/net/ethernet/microchip
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
..
sparx5 net: sparx5: Do not use mac_addr uninitialized in mchp_sparx5_probe() 2021-06-28 15:50:21 -07:00
enc28j60_hw.h
enc28j60.c netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
encx24j600_hw.h net: encx24j600: fix kernel-doc syntax in file headers 2021-05-20 15:25:38 -07:00
encx24j600-regmap.c drivers/net/ethernet: clean up mis-targeted comments 2020-09-25 16:29:00 -07:00
encx24j600.c net: encx24j600: fix kernel-doc syntax in file headers 2021-05-20 15:25:38 -07:00
Kconfig net: sparx5: add the basic sparx5 driver 2021-06-24 11:28:12 -07:00
lan743x_ethtool.c lan743x: remove redundant intializations of pointers adapter and phydev 2021-03-29 10:56:41 -07:00
lan743x_ethtool.h
lan743x_main.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
lan743x_main.h lan743x: boost performance on cpu archs w/o dma cache snooping 2021-02-16 15:08:48 -08:00
lan743x_ptp.c lan743x: Added fixed link and RGMII support 2020-06-01 11:51:17 -07:00
lan743x_ptp.h Support LAN743x PTP periodic output on any GPIO 2019-11-11 12:46:56 -08:00
Makefile net: sparx5: add the basic sparx5 driver 2021-06-24 11:28:12 -07:00