netdev: octeon_mgmt: drop redundant mac address check
Subsystems (2)
PATCH 1/1 netdev: octeon_mgmt: drop redundant mac address check
Checking if MAC address is valid using is_valid_ether_addr() is already done in of_get_mac_address().
Signed-off-by Luka Perkov <[email protected]>
--- drivers/net/ethernet/octeon/octeon_mgmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/octeon/octeon_mgmt.c +1 -1
@@ -1545,7 +1545,7 @@ static int octeon_mgmt_probe(struct platform_device *pdev) mac =of_get_mac_address (pdev->dev.of_node); -if (mac &&is_valid_ether_addr (mac)) +if (mac)memcpy (netdev->dev_addr, mac,ETH_ALEN );else eth_hw_addr_random (netdev);
Signature · 1 line
1.8.4.1
Quoted 4 lines · Luka Perkov
Checking if MAC address is valid using
is_valid_ether_addr()is already done inof_get_mac_address().Signed-off-by Luka Perkov <[email protected]>
This looks sane, but I haven't tested it...
Acked-by David Daney <[email protected]>
Quoted 18 lines
--- drivers/net/ethernet/octeon/octeon_mgmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/octeon/octeon_mgmt.c +1
-1@@ -1545,7 +1545,7 @@ static int octeon_mgmt_probe(struct platform_device *pdev) mac =of_get_mac_address (pdev->dev.of_node); -if (mac &&is_valid_ether_addr (mac)) +if (mac)memcpy (netdev->dev_addr, mac,ETH_ALEN );else eth_hw_addr_random (netdev);