2013-10-29 21:24:22

by Laurent Navet

[permalink] [raw]
Subject: [PATCH] mvneta: remove double validation of mac address

Mac address validity is already checked in of_get_mac_address().
No need to do it twice.

Signed-off-by: Laurent Navet <[email protected]>
---
drivers/net/ethernet/marvell/mvneta.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index e35bac7..7d99e695 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2811,7 +2811,7 @@ static int mvneta_probe(struct platform_device *pdev)
}

dt_mac_addr = of_get_mac_address(dn);
- if (dt_mac_addr && is_valid_ether_addr(dt_mac_addr)) {
+ if (dt_mac_addr) {
mac_from = "device tree";
memcpy(dev->dev_addr, dt_mac_addr, ETH_ALEN);
} else {
--
1.8.4.rc3


2013-10-29 23:35:25

by Thomas Petazzoni

[permalink] [raw]
Subject: Re: [PATCH] mvneta: remove double validation of mac address

Dear Laurent Navet,

On Tue, 29 Oct 2013 22:25:06 +0100, Laurent Navet wrote:
> Mac address validity is already checked in of_get_mac_address().
> No need to do it twice.
>
> Signed-off-by: Laurent Navet <[email protected]>

Thanks, but an identical patch has been posted by Luka Perkov
<[email protected]> just a few days ago. See
http://www.spinics.net/lists/netdev/msg255454.html.

Thanks,

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com