Skip to contentSkip to conversation

arc_emac: drop redundant mac address check

PATCH Applied Luka Perkov 2 participants 2 messages Oct 29, 2013 – Oct 30, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arc_emac: drop redundant mac address check

Checking if MAC address is valid using is_valid_ether_addr() is already done in of_get_mac_address(). While at it, reorganize checking so it matches checks in other drivers.

CC Alexey Brodkin <[email protected]>
CC David Miller <[email protected]>

---
v1->v2:

* cosmetic commit message fix based on comment from David Miller

---
 drivers/net/ethernet/arc/emac_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/arc/emac_main.c +3 -3
index 9e16014..d818ded 100644
@@ -725,10 +725,10 @@ static int arc_emac_probe(struct platform_device *pdev)
 	/* Get MAC address from device tree */
 	mac_addr = of_get_mac_address(pdev->dev.of_node);
 
-	if (!mac_addr || !is_valid_ether_addr(mac_addr))
-		eth_hw_addr_random(ndev);
-	else
+	if (mac_addr)
 		memcpy(ndev->dev_addr, mac_addr, ETH_ALEN);
+	else
+		eth_hw_addr_random(ndev);
 
 	dev_info(&pdev->dev, "MAC address is now %pM\n", ndev->dev_addr);
 
Signature · 1 line
1.8.4.2
maintainer Applied
#1 lore raw

From: Luka Perkov <[email protected]>
Date: Wed, 30 Oct 2013 00:11:00 +0100

Quoted 5 lines

Checking if MAC address is valid using is_valid_ether_addr() is already done in of_get_mac_address(). While at it, reorganize checking so it matches checks in other drivers.

Applied.