Subject: Re: [PATCH net] drivers: net: Don't print unpopulated net_device name

From: Stephen Hemminger <[email-masked]>
Date: Tue, 10 May 2016 11:31:48 -0700

On Tue, 10 May 2016 17:43:21 +0100
Harvey Hunt <[email-masked]> wrote:

> For ethernet devices, net_device.name will be eth%d before
> register_netdev() is called. Don't print the net_device name until
> the format string is replaced.
> 
> Cc: Robert Jarzmik <[email-masked]>
> Cc: Barry Song <[email-masked]>
> Cc: Marcel Ziswiler <[email-masked]>
> Cc: [email-masked]
> Cc: [email-masked]
> 
> Signed-off-by: Harvey Hunt <[email-masked]>
> ---
> I've tested this patch on a board that has a DM9000, but haven't 
> tested the other two network devices.
> 
>  drivers/net/ethernet/davicom/dm9000.c   | 3 +--
>  drivers/net/ethernet/micrel/ks8695net.c | 3 +--
>  drivers/net/ethernet/netx-eth.c         | 3 +--
>  3 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
> index 48d9194..89dcaa1 100644
> --- a/drivers/net/ethernet/davicom/dm9000.c
> +++ b/drivers/net/ethernet/davicom/dm9000.c
> @@ -1686,8 +1686,7 @@ dm9000_probe(struct platform_device *pdev)
>  	}
>  
>  	if (!is_valid_ether_addr(ndev->dev_addr)) {
> -		dev_warn(db->dev, "%s: Invalid ethernet MAC address. Please "
> -			 "set using ifconfig\n", ndev->name);
> +		dev_warn(db->dev, "Invalid ethernet MAC address. Please set using ifconfig\n");

ifconfig is deprecated, therefore please don't tell users to use it.