diff mbox

[net-next,3/4] appletalk: convert printks to pr_<level>

Message ID 1392363826-8256-4-git-send-email-wangweidong1@huawei.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

wangweidong Feb. 14, 2014, 7:43 a.m. UTC
Prefer pr_<level> then printk(LEVEL).

Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
---
 net/appletalk/aarp.c |  2 +-
 net/appletalk/ddp.c  | 13 ++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

Comments

David Miller Feb. 14, 2014, 9:21 p.m. UTC | #1
From: Wang Weidong <wangweidong1@huawei.com>
Date: Fri, 14 Feb 2014 15:43:45 +0800

> Prefer pr_<level> then printk(LEVEL).
> 
> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>

Not applied, please sort out the pr_debug() vs. printk(KERN_DEBUG
differences pointed out to you.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov Feb. 14, 2014, 9:45 p.m. UTC | #2
Hello.

On 02/14/2014 10:43 AM, Wang Weidong wrote:

> Prefer pr_<level> then printk(LEVEL).

> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>

[...]
> diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
> index 06e0d19..9189d3c 100644
> --- a/net/appletalk/ddp.c
> +++ b/net/appletalk/ddp.c
> @@ -704,9 +704,9 @@ static int atif_ioctl(int cmd, void __user *arg)
>   		if ((dev->flags & IFF_POINTOPOINT) &&
>   		    atalk_find_interface(sa->sat_addr.s_net,
>   					 sa->sat_addr.s_node)) {
> -			printk(KERN_DEBUG "AppleTalk: point-to-point "
> -			       "interface added with "
> -			       "existing address\n");
> +			pr_debug("AppleTalk: point-to-point "
> +				 "interface added with "
> +				 "existing address\n");
>   			add_route = 0;
>   		}
>
[...]
> @@ -1329,8 +1328,8 @@ static int atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
>   		 * needs to be broadcast onto the default network?
>   		 */
>   		if (dev->type == ARPHRD_PPP)
> -			printk(KERN_DEBUG "AppleTalk: didn't forward broadcast "
> -					  "packet received from PPP iface\n");
> +			pr_debug("AppleTalk: didn't forward broadcast "
> +				 "packet received from PPP iface\n");

    pr_debug() is not equivalent to printk(KERN_DEBUG). It will only print a 
message if DEBUG is defined or if dynamic debugging is enabled.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
wangweidong Feb. 15, 2014, 1:19 a.m. UTC | #3
On 2014/2/15 5:45, Sergei Shtylyov wrote:
> Hello.
> 
> On 02/14/2014 10:43 AM, Wang Weidong wrote:
> 
>> Prefer pr_<level> then printk(LEVEL).
> 
>> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
> 
> [...]
>> diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
>> index 06e0d19..9189d3c 100644
>> --- a/net/appletalk/ddp.c
>> +++ b/net/appletalk/ddp.c
>> @@ -704,9 +704,9 @@ static int atif_ioctl(int cmd, void __user *arg)
>>           if ((dev->flags & IFF_POINTOPOINT) &&
>>               atalk_find_interface(sa->sat_addr.s_net,
>>                        sa->sat_addr.s_node)) {
>> -            printk(KERN_DEBUG "AppleTalk: point-to-point "
>> -                   "interface added with "
>> -                   "existing address\n");
>> +            pr_debug("AppleTalk: point-to-point "
>> +                 "interface added with "
>> +                 "existing address\n");
>>               add_route = 0;
>>           }
>>
> [...]
>> @@ -1329,8 +1328,8 @@ static int atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
>>            * needs to be broadcast onto the default network?
>>            */
>>           if (dev->type == ARPHRD_PPP)
>> -            printk(KERN_DEBUG "AppleTalk: didn't forward broadcast "
>> -                      "packet received from PPP iface\n");
>> +            pr_debug("AppleTalk: didn't forward broadcast "
>> +                 "packet received from PPP iface\n");
> 
>    pr_debug() is not equivalent to printk(KERN_DEBUG). It will only print a message if DEBUG is defined or if dynamic debugging is enabled.
> 
Got it.

WBR, Wang

> WBR, Sergei
> 
> 
> 


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
index d1c55d8..9ec36ed 100644
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -883,7 +883,7 @@  void __init aarp_proto_init(void)
 {
 	aarp_dl = register_snap_client(aarp_snap_id, aarp_rcv);
 	if (!aarp_dl)
-		printk(KERN_CRIT "Unable to register AARP with SNAP.\n");
+		pr_crit("Unable to register AARP with SNAP.\n");
 	setup_timer(&aarp_timer, aarp_expire_timeout, 0);
 	aarp_timer.expires  = jiffies + sysctl_aarp_expiry_time;
 	add_timer(&aarp_timer);
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 06e0d19..9189d3c 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -704,9 +704,9 @@  static int atif_ioctl(int cmd, void __user *arg)
 		if ((dev->flags & IFF_POINTOPOINT) &&
 		    atalk_find_interface(sa->sat_addr.s_net,
 					 sa->sat_addr.s_node)) {
-			printk(KERN_DEBUG "AppleTalk: point-to-point "
-			       "interface added with "
-			       "existing address\n");
+			pr_debug("AppleTalk: point-to-point "
+				 "interface added with "
+				 "existing address\n");
 			add_route = 0;
 		}
 
@@ -768,8 +768,7 @@  static int atif_ioctl(int cmd, void __user *arg)
 		} else {
 			limit = ntohs(nr->nr_lastnet);
 			if (limit - ntohs(nr->nr_firstnet) > 4096) {
-				printk(KERN_WARNING "Too many routes/"
-				       "iface.\n");
+				pr_warn("Too many routes/iface.\n");
 				return -EINVAL;
 			}
 			if (add_route)
@@ -1329,8 +1328,8 @@  static int atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
 		 * needs to be broadcast onto the default network?
 		 */
 		if (dev->type == ARPHRD_PPP)
-			printk(KERN_DEBUG "AppleTalk: didn't forward broadcast "
-					  "packet received from PPP iface\n");
+			pr_debug("AppleTalk: didn't forward broadcast "
+				 "packet received from PPP iface\n");
 		goto free_it;
 	}