All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] arc_emac: drop redundant mac address check
@ 2013-10-29 23:11 Luka Perkov
  2013-10-30  2:53 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Luka Perkov @ 2013-10-29 23:11 UTC (permalink / raw)
  To: netdev; +Cc: Luka Perkov, Alexey Brodkin, David Miller

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.

Signed-off-by: Luka Perkov <luka@openwrt.org>
CC: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
CC: David Miller <davem@davemloft.net>
---
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(-)

diff --git a/drivers/net/ethernet/arc/emac_main.c b/drivers/net/ethernet/arc/emac_main.c
index 9e16014..d818ded 100644
--- a/drivers/net/ethernet/arc/emac_main.c
+++ b/drivers/net/ethernet/arc/emac_main.c
@@ -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);
 
-- 
1.8.4.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] arc_emac: drop redundant mac address check
  2013-10-29 23:11 [PATCH v2] arc_emac: drop redundant mac address check Luka Perkov
@ 2013-10-30  2:53 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-10-30  2:53 UTC (permalink / raw)
  To: luka; +Cc: netdev, Alexey.Brodkin

From: Luka Perkov <luka@openwrt.org>
Date: Wed, 30 Oct 2013 00:11:00 +0100

> 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.
> 
> Signed-off-by: Luka Perkov <luka@openwrt.org>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-30  2:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-29 23:11 [PATCH v2] arc_emac: drop redundant mac address check Luka Perkov
2013-10-30  2:53 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.