mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2] net: use dev_warn() when no MAC address is set
@ 2018-05-18 20:41 Vivien Didelot
  2018-05-18 20:44 ` Sam Ravnborg
  2018-05-22  6:41 ` Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Vivien Didelot @ 2018-05-18 20:41 UTC (permalink / raw)
  To: barebox; +Cc: Sam Ravnborg, Vivien Didelot

When a SoC such as VF610 has no addresses programmed for both its
interfaces, the "No MAC address set" warning can be confusing:

    booting 'net'
    WARNING: net: warning: No MAC address set. Using random address a2:e8:be:79:72:01
    WARNING: net: warning: No MAC address set. Using random address aa:d5:d7:10:c0:42

This patch uses dev_warn() instead and removes the redundant "warning":

    booting 'net'
    WARNING: eth0: No MAC address set. Using random address a2:e8:be:79:72:01
    WARNING: eth1: No MAC address set. Using random address 4e:be:c4:bc:ce:36

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 net/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/net.c b/net/net.c
index 94954677c..d21855415 100644
--- a/net/net.c
+++ b/net/net.c
@@ -330,7 +330,7 @@ static struct net_connection *net_new(struct eth_device *edev, IPaddr_t dest,
 		char str[sizeof("xx:xx:xx:xx:xx:xx")];
 		random_ether_addr(edev->ethaddr);
 		ethaddr_to_string(edev->ethaddr, str);
-		pr_warn("warning: No MAC address set. Using random address %s\n", str);
+		dev_warn(&edev->dev, "No MAC address set. Using random address %s\n", str);
 		eth_set_ethaddr(edev, edev->ethaddr);
 	}
 
-- 
2.17.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH v2] net: use dev_warn() when no MAC address is set
  2018-05-18 20:41 [PATCH v2] net: use dev_warn() when no MAC address is set Vivien Didelot
@ 2018-05-18 20:44 ` Sam Ravnborg
  2018-05-22  6:41 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sam Ravnborg @ 2018-05-18 20:44 UTC (permalink / raw)
  To: Vivien Didelot; +Cc: barebox

On Fri, May 18, 2018 at 04:41:29PM -0400, Vivien Didelot wrote:
> When a SoC such as VF610 has no addresses programmed for both its
> interfaces, the "No MAC address set" warning can be confusing:
> 
>     booting 'net'
>     WARNING: net: warning: No MAC address set. Using random address a2:e8:be:79:72:01
>     WARNING: net: warning: No MAC address set. Using random address aa:d5:d7:10:c0:42
> 
> This patch uses dev_warn() instead and removes the redundant "warning":
> 
>     booting 'net'
>     WARNING: eth0: No MAC address set. Using random address a2:e8:be:79:72:01
>     WARNING: eth1: No MAC address set. Using random address 4e:be:c4:bc:ce:36
> 
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH v2] net: use dev_warn() when no MAC address is set
  2018-05-18 20:41 [PATCH v2] net: use dev_warn() when no MAC address is set Vivien Didelot
  2018-05-18 20:44 ` Sam Ravnborg
@ 2018-05-22  6:41 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2018-05-22  6:41 UTC (permalink / raw)
  To: Vivien Didelot; +Cc: barebox, Sam Ravnborg

On Fri, May 18, 2018 at 04:41:29PM -0400, Vivien Didelot wrote:
> When a SoC such as VF610 has no addresses programmed for both its
> interfaces, the "No MAC address set" warning can be confusing:
> 
>     booting 'net'
>     WARNING: net: warning: No MAC address set. Using random address a2:e8:be:79:72:01
>     WARNING: net: warning: No MAC address set. Using random address aa:d5:d7:10:c0:42
> 
> This patch uses dev_warn() instead and removes the redundant "warning":
> 
>     booting 'net'
>     WARNING: eth0: No MAC address set. Using random address a2:e8:be:79:72:01
>     WARNING: eth1: No MAC address set. Using random address 4e:be:c4:bc:ce:36
> 
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Applied, thanks

Sascha

> ---
>  net/net.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/net.c b/net/net.c
> index 94954677c..d21855415 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -330,7 +330,7 @@ static struct net_connection *net_new(struct eth_device *edev, IPaddr_t dest,
>  		char str[sizeof("xx:xx:xx:xx:xx:xx")];
>  		random_ether_addr(edev->ethaddr);
>  		ethaddr_to_string(edev->ethaddr, str);
> -		pr_warn("warning: No MAC address set. Using random address %s\n", str);
> +		dev_warn(&edev->dev, "No MAC address set. Using random address %s\n", str);
>  		eth_set_ethaddr(edev, edev->ethaddr);
>  	}
>  
> -- 
> 2.17.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2018-05-22  6:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-18 20:41 [PATCH v2] net: use dev_warn() when no MAC address is set Vivien Didelot
2018-05-18 20:44 ` Sam Ravnborg
2018-05-22  6:41 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox