Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1399604

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

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH net] drivers: net: Don't print unpopulated net_device name
Date 2016-05-12 01:30 +0200
Message-ID <rxLJM-1vQ-1@gated-at.bofh.it> (permalink)
References <rxj19-6hc-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Harvey Hunt <harvey.hunt@imgtec.com>
Date: Tue, 10 May 2016 17:43:21 +0100

> @@ -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");
>  
>  		eth_hw_addr_random(ndev);
>  		mac_src = "random";

If we don't print the netdev name, it's harder for the user to see which
adapter has the problem.

Therefore, it is better if you save some boolean state into a local variable
here, then print the warning right after register_netdev().

Likewise for the rest of your changes too.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net] drivers: net: Don't print unpopulated net_device name Harvey Hunt <harvey.hunt@imgtec.com> - 2016-05-10 18:50 +0200
  Re: [PATCH net] drivers: net: Don't print unpopulated net_device  name Stephen Hemminger <stephen@networkplumber.org> - 2016-05-10 20:40 +0200
    Re: [PATCH net] drivers: net: Don't print unpopulated net_device name Harvey Hunt <harvey.hunt@imgtec.com> - 2016-05-12 15:30 +0200
  Re: [PATCH net] drivers: net: Don't print unpopulated net_device  name David Miller <davem@davemloft.net> - 2016-05-12 01:30 +0200
    Re: [PATCH net] drivers: net: Don't print unpopulated net_device name Harvey Hunt <harvey.hunt@imgtec.com> - 2016-05-12 15:30 +0200

csiph-web