netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] unix: convert printks to pr_<level>
@ 2013-12-06  6:09 Wang Weidong
  2013-12-06  9:22 ` Daniel Borkmann
  2013-12-06 10:03 ` [PATCH net-next v2] " Wang Weidong
  0 siblings, 2 replies; 7+ messages in thread
From: Wang Weidong @ 2013-12-06  6:09 UTC (permalink / raw)
  To: David Miller; +Cc: edumazet, ebiederm, gaofeng, jacob.e.keller, netdev

use pr_<level> instead of printk(LEVEL)

Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
---
 net/unix/af_unix.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 4155ed3..ca98e61 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -80,6 +80,9 @@
  *		  with BSD names.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#define DEBUG
+
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
@@ -366,7 +369,7 @@ static void unix_sock_destructor(struct sock *sk)
 	WARN_ON(!sk_unhashed(sk));
 	WARN_ON(sk->sk_socket);
 	if (!sock_flag(sk, SOCK_DEAD)) {
-		printk(KERN_INFO "Attempt to release alive unix socket: %p\n", sk);
+		pr_info("Attempt to release alive unix socket: %p\n", sk);
 		return;
 	}
 
@@ -378,7 +381,7 @@ static void unix_sock_destructor(struct sock *sk)
 	sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
 	local_bh_enable();
 #ifdef UNIX_REFCNT_DEBUG
-	printk(KERN_DEBUG "UNIX %p is destroyed, %ld are still alive.\n", sk,
+	pr_debug("UNIX %p is destroyed, %ld are still alive.\n", sk,
 		atomic_long_read(&unix_nr_socks));
 #endif
 }
@@ -2434,8 +2437,7 @@ static int __init af_unix_init(void)
 
 	rc = proto_register(&unix_proto, 1);
 	if (rc != 0) {
-		printk(KERN_CRIT "%s: Cannot create unix_sock SLAB cache!\n",
-		       __func__);
+		pr_crit("%s: Cannot create unix_sock SLAB cache!\n", __func__);
 		goto out;
 	}
 
-- 
1.6.0.2

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

* Re: [PATCH net-next] unix: convert printks to pr_<level>
  2013-12-06  6:09 [PATCH net-next] unix: convert printks to pr_<level> Wang Weidong
@ 2013-12-06  9:22 ` Daniel Borkmann
  2013-12-06  9:32   ` Wang Weidong
  2013-12-06 10:03 ` [PATCH net-next v2] " Wang Weidong
  1 sibling, 1 reply; 7+ messages in thread
From: Daniel Borkmann @ 2013-12-06  9:22 UTC (permalink / raw)
  To: Wang Weidong
  Cc: David Miller, edumazet, ebiederm, gaofeng, jacob.e.keller, netdev

On 12/06/2013 07:09 AM, Wang Weidong wrote:
> use pr_<level> instead of printk(LEVEL)
>
> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
> ---
>   net/unix/af_unix.c |   10 ++++++----
>   1 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index 4155ed3..ca98e61 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -80,6 +80,9 @@
>    *		  with BSD names.
>    */
>
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +#define DEBUG
> +

Why do you define DEBUG here ?

>   #include <linux/module.h>
>   #include <linux/kernel.h>
>   #include <linux/signal.h>
> @@ -366,7 +369,7 @@ static void unix_sock_destructor(struct sock *sk)
>   	WARN_ON(!sk_unhashed(sk));
>   	WARN_ON(sk->sk_socket);
>   	if (!sock_flag(sk, SOCK_DEAD)) {
> -		printk(KERN_INFO "Attempt to release alive unix socket: %p\n", sk);
> +		pr_info("Attempt to release alive unix socket: %p\n", sk);
>   		return;
>   	}
>
> @@ -378,7 +381,7 @@ static void unix_sock_destructor(struct sock *sk)
>   	sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
>   	local_bh_enable();
>   #ifdef UNIX_REFCNT_DEBUG
> -	printk(KERN_DEBUG "UNIX %p is destroyed, %ld are still alive.\n", sk,
> +	pr_debug("UNIX %p is destroyed, %ld are still alive.\n", sk,
>   		atomic_long_read(&unix_nr_socks));
>   #endif
>   }
> @@ -2434,8 +2437,7 @@ static int __init af_unix_init(void)
>
>   	rc = proto_register(&unix_proto, 1);
>   	if (rc != 0) {
> -		printk(KERN_CRIT "%s: Cannot create unix_sock SLAB cache!\n",
> -		       __func__);
> +		pr_crit("%s: Cannot create unix_sock SLAB cache!\n", __func__);
>   		goto out;
>   	}
>
>

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

* Re: [PATCH net-next] unix: convert printks to pr_<level>
  2013-12-06  9:22 ` Daniel Borkmann
@ 2013-12-06  9:32   ` Wang Weidong
  2013-12-06  9:40     ` Daniel Borkmann
  0 siblings, 1 reply; 7+ messages in thread
From: Wang Weidong @ 2013-12-06  9:32 UTC (permalink / raw)
  To: Daniel Borkmann
  Cc: David Miller, edumazet, ebiederm, gaofeng, jacob.e.keller, netdev

On 2013/12/6 17:22, Daniel Borkmann wrote:
> On 12/06/2013 07:09 AM, Wang Weidong wrote:
>> use pr_<level> instead of printk(LEVEL)
>>
>> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
>> ---
>>   net/unix/af_unix.c |   10 ++++++----
>>   1 files changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
>> index 4155ed3..ca98e61 100644
>> --- a/net/unix/af_unix.c
>> +++ b/net/unix/af_unix.c
>> @@ -80,6 +80,9 @@
>>    *          with BSD names.
>>    */
>>
>> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>> +#define DEBUG
>> +
> 
> Why do you define DEBUG here ?
> 
I think the pr_debug != printk(KERN_DEBUG), equal when define DEBUG.

Regards.
Wang

>>   #include <linux/module.h>
>>   #include <linux/kernel.h>
>>   #include <linux/signal.h>
>> @@ -366,7 +369,7 @@ static void unix_sock_destructor(struct sock *sk)
>>       WARN_ON(!sk_unhashed(sk));
>>       WARN_ON(sk->sk_socket);
>>       if (!sock_flag(sk, SOCK_DEAD)) {
>> -        printk(KERN_INFO "Attempt to release alive unix socket: %p\n", sk);
>> +        pr_info("Attempt to release alive unix socket: %p\n", sk);
>>           return;
>>       }
>>
>> @@ -378,7 +381,7 @@ static void unix_sock_destructor(struct sock *sk)
>>       sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
>>       local_bh_enable();
>>   #ifdef UNIX_REFCNT_DEBUG
>> -    printk(KERN_DEBUG "UNIX %p is destroyed, %ld are still alive.\n", sk,
>> +    pr_debug("UNIX %p is destroyed, %ld are still alive.\n", sk,
>>           atomic_long_read(&unix_nr_socks));
>>   #endif
>>   }
>> @@ -2434,8 +2437,7 @@ static int __init af_unix_init(void)
>>
>>       rc = proto_register(&unix_proto, 1);
>>       if (rc != 0) {
>> -        printk(KERN_CRIT "%s: Cannot create unix_sock SLAB cache!\n",
>> -               __func__);
>> +        pr_crit("%s: Cannot create unix_sock SLAB cache!\n", __func__);
>>           goto out;
>>       }
>>
>>
> 
> .
> 

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

* Re: [PATCH net-next] unix: convert printks to pr_<level>
  2013-12-06  9:32   ` Wang Weidong
@ 2013-12-06  9:40     ` Daniel Borkmann
  2013-12-06  9:44       ` Wang Weidong
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Borkmann @ 2013-12-06  9:40 UTC (permalink / raw)
  To: Wang Weidong
  Cc: David Miller, edumazet, ebiederm, gaofeng, jacob.e.keller, netdev,
	Joe Perches

On 12/06/2013 10:32 AM, Wang Weidong wrote:
> On 2013/12/6 17:22, Daniel Borkmann wrote:
>> On 12/06/2013 07:09 AM, Wang Weidong wrote:
>>> use pr_<level> instead of printk(LEVEL)
>>>
>>> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
>>> ---
>>>    net/unix/af_unix.c |   10 ++++++----
>>>    1 files changed, 6 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
>>> index 4155ed3..ca98e61 100644
>>> --- a/net/unix/af_unix.c
>>> +++ b/net/unix/af_unix.c
>>> @@ -80,6 +80,9 @@
>>>     *          with BSD names.
>>>     */
>>>
>>> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>>> +#define DEBUG
>>> +
>>
>> Why do you define DEBUG here ?
>>
> I think the pr_debug != printk(KERN_DEBUG), equal when define DEBUG.

Ok, then please read Documentation/dynamic-debug-howto.txt

pr_debug() is part of the dynamic debugging framework and
can be enabled / disabled at runtime when configured. So
that define does not belong here.

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

* Re: [PATCH net-next] unix: convert printks to pr_<level>
  2013-12-06  9:40     ` Daniel Borkmann
@ 2013-12-06  9:44       ` Wang Weidong
  0 siblings, 0 replies; 7+ messages in thread
From: Wang Weidong @ 2013-12-06  9:44 UTC (permalink / raw)
  To: Daniel Borkmann
  Cc: David Miller, edumazet, ebiederm, gaofeng, jacob.e.keller, netdev,
	Joe Perches

On 2013/12/6 17:40, Daniel Borkmann wrote:
> On 12/06/2013 10:32 AM, Wang Weidong wrote:
>> On 2013/12/6 17:22, Daniel Borkmann wrote:
>>> On 12/06/2013 07:09 AM, Wang Weidong wrote:
>>>> use pr_<level> instead of printk(LEVEL)
>>>>
>>>> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
>>>> ---
>>>>    net/unix/af_unix.c |   10 ++++++----
>>>>    1 files changed, 6 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
>>>> index 4155ed3..ca98e61 100644
>>>> --- a/net/unix/af_unix.c
>>>> +++ b/net/unix/af_unix.c
>>>> @@ -80,6 +80,9 @@
>>>>     *          with BSD names.
>>>>     */
>>>>
>>>> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>>>> +#define DEBUG
>>>> +
>>>
>>> Why do you define DEBUG here ?
>>>
>> I think the pr_debug != printk(KERN_DEBUG), equal when define DEBUG.
> 
> Ok, then please read Documentation/dynamic-debug-howto.txt
> 
> pr_debug() is part of the dynamic debugging framework and
> can be enabled / disabled at runtime when configured. So
> that define does not belong here.
> 
Yes, You are right. I will fix it.

Thanks.

> 

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

* [PATCH net-next v2] unix: convert printks to pr_<level>
  2013-12-06  6:09 [PATCH net-next] unix: convert printks to pr_<level> Wang Weidong
  2013-12-06  9:22 ` Daniel Borkmann
@ 2013-12-06 10:03 ` Wang Weidong
  2013-12-06 21:36   ` David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Wang Weidong @ 2013-12-06 10:03 UTC (permalink / raw)
  To: David Miller
  Cc: edumazet, ebiederm, gaofeng, jacob.e.keller, netdev,
	Daniel Borkmann

use pr_<level> instead of printk(LEVEL)

Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
---
 net/unix/af_unix.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 01625cc..8136222 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -80,6 +80,8 @@
  *		  with BSD names.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
@@ -366,7 +368,7 @@ static void unix_sock_destructor(struct sock *sk)
 	WARN_ON(!sk_unhashed(sk));
 	WARN_ON(sk->sk_socket);
 	if (!sock_flag(sk, SOCK_DEAD)) {
-		printk(KERN_INFO "Attempt to release alive unix socket: %p\n", sk);
+		pr_info("Attempt to release alive unix socket: %p\n", sk);
 		return;
 	}
 
@@ -378,7 +380,7 @@ static void unix_sock_destructor(struct sock *sk)
 	sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
 	local_bh_enable();
 #ifdef UNIX_REFCNT_DEBUG
-	printk(KERN_DEBUG "UNIX %p is destroyed, %ld are still alive.\n", sk,
+	pr_debug("UNIX %p is destroyed, %ld are still alive.\n", sk,
 		atomic_long_read(&unix_nr_socks));
 #endif
 }
@@ -2433,8 +2435,7 @@ static int __init af_unix_init(void)
 
 	rc = proto_register(&unix_proto, 1);
 	if (rc != 0) {
-		printk(KERN_CRIT "%s: Cannot create unix_sock SLAB cache!\n",
-		       __func__);
+		pr_crit("%s: Cannot create unix_sock SLAB cache!\n", __func__);
 		goto out;
 	}
 
-- 
1.7.12

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

* Re: [PATCH net-next v2] unix: convert printks to pr_<level>
  2013-12-06 10:03 ` [PATCH net-next v2] " Wang Weidong
@ 2013-12-06 21:36   ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2013-12-06 21:36 UTC (permalink / raw)
  To: wangweidong1
  Cc: edumazet, ebiederm, gaofeng, jacob.e.keller, netdev, dborkman

From: Wang Weidong <wangweidong1@huawei.com>
Date: Fri, 6 Dec 2013 18:03:36 +0800

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

Applied, thanks.

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

end of thread, other threads:[~2013-12-06 21:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-06  6:09 [PATCH net-next] unix: convert printks to pr_<level> Wang Weidong
2013-12-06  9:22 ` Daniel Borkmann
2013-12-06  9:32   ` Wang Weidong
2013-12-06  9:40     ` Daniel Borkmann
2013-12-06  9:44       ` Wang Weidong
2013-12-06 10:03 ` [PATCH net-next v2] " Wang Weidong
2013-12-06 21:36   ` David Miller

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).