* [PATCH net-next] w5300: using eth_hw_addr_random() for random MAC and set device flag
@ 2012-08-23 7:28 Wei Yongjun
2012-08-24 17:31 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2012-08-23 7:28 UTC (permalink / raw)
To: davem; +Cc: yongjun_wei, netdev
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Using eth_hw_addr_random() to generate a random Ethernet address
(MAC) to be used by a net device and set addr_assign_type.
Not need to duplicating its implementation.
spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
drivers/net/ethernet/wiznet/w5300.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/wiznet/w5300.c b/drivers/net/ethernet/wiznet/w5300.c
index bdd8891..88943d9 100644
--- a/drivers/net/ethernet/wiznet/w5300.c
+++ b/drivers/net/ethernet/wiznet/w5300.c
@@ -557,8 +557,7 @@ static int __devinit w5300_hw_probe(struct platform_device *pdev)
if (data && is_valid_ether_addr(data->mac_addr)) {
memcpy(ndev->dev_addr, data->mac_addr, ETH_ALEN);
} else {
- eth_random_addr(ndev->dev_addr);
- ndev->addr_assign_type |= NET_ADDR_RANDOM;
+ eth_hw_addr_random(ndev);
}
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] w5300: using eth_hw_addr_random() for random MAC and set device flag
2012-08-23 7:28 [PATCH net-next] w5300: using eth_hw_addr_random() for random MAC and set device flag Wei Yongjun
@ 2012-08-24 17:31 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-08-24 17:31 UTC (permalink / raw)
To: weiyj.lk; +Cc: yongjun_wei, netdev
From: Wei Yongjun <weiyj.lk@gmail.com>
Date: Thu, 23 Aug 2012 15:28:40 +0800
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Using eth_hw_addr_random() to generate a random Ethernet address
> (MAC) to be used by a net device and set addr_assign_type.
> Not need to duplicating its implementation.
>
> spatch with a semantic match is used to found this problem.
> (http://coccinelle.lip6.fr/)
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-24 17:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-23 7:28 [PATCH net-next] w5300: using eth_hw_addr_random() for random MAC and set device flag Wei Yongjun
2012-08-24 17:31 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).