netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Vaishali Thakkar <vthakkar1994@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: systemport: Use eth_hw_addr_random
Date: Wed, 08 Jul 2015 22:01:49 -0700	[thread overview]
Message-ID: <559E003D.3050101@gmail.com> (raw)
In-Reply-To: <20150708051930.GA13317@vaishali-Ideapad-Z570>

Le 07/07/15 22:19, Vaishali Thakkar a écrit :
> Use eth_hw_addr_random() instead of calling random_ether_addr().
> Here, this change is setting addr_assign_type to NET_ADDR_RANDOM.
> 
> The Coccinelle semantic patch that performs this transformation
> is as follows:
> 
> @@
> identifier a,b;
> @@
> 
> -random_ether_addr(a->b);
> +eth_hw_addr_random(a);
> 
> Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
> ---
> Note that this patch is compile tested only and I have used file
> drivers/net/ethernet/hisilicon/hix5hd2_gmac.c as a reference.
> Also, original call didn't make assignment to NET_ADDR_RANDOM. So,
> it would be good if someone can test this change.

Thanks, I will give this a try and report.

> ---
>  drivers/net/ethernet/broadcom/bcmsysport.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
> index 909ad7a..4566cdf 100644
> --- a/drivers/net/ethernet/broadcom/bcmsysport.c
> +++ b/drivers/net/ethernet/broadcom/bcmsysport.c
> @@ -1793,7 +1793,7 @@ static int bcm_sysport_probe(struct platform_device *pdev)
>  	macaddr = of_get_mac_address(dn);
>  	if (!macaddr || !is_valid_ether_addr(macaddr)) {
>  		dev_warn(&pdev->dev, "using random Ethernet MAC\n");
> -		random_ether_addr(dev->dev_addr);
> +		eth_hw_addr_random(dev);
>  	} else {
>  		ether_addr_copy(dev->dev_addr, macaddr);
>  	}
> 


-- 
Florian

  reply	other threads:[~2015-07-09  5:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-08  5:19 [PATCH] net: systemport: Use eth_hw_addr_random Vaishali Thakkar
2015-07-09  5:01 ` Florian Fainelli [this message]
2015-07-09 21:31 ` Florian Fainelli
2015-07-09 21:51 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=559E003D.3050101@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vthakkar1994@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).