unix: convert printks to pr_<level>
Subsystems (3)
PATCH 1/1 unix: convert printks to pr_<level>
use pr_<level> instead of printk(LEVEL)
--- net/unix/af_unix.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
net/unix/af_unix.c +6 -4
@@ -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; }
Signature · 1 line
1.6.0.2
Quoted 12 lines · Wang Weidong
use pr_<level> instead of printk(LEVEL)
Signed-off-by Wang Weidong <[email protected]>--- net/unix/af_unix.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)net/unix/af_unix.c +0
-0
net/unix/af_unix.c line 85
Quoted 6 lines
net/unix/af_unix.c +3
-0@@ -80,6 +80,9 @@* with BSD names. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#define DEBUG +
Why do you define DEBUG here ?
Quoted 32 lines
net/unix/af_unix.c +3
-4#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; }
Quoted 16 lines · Daniel Borkmann
Quoted 15 lines · Wang Weidong
use pr_<level> instead of printk(LEVEL)
Signed-off-by Wang Weidong <[email protected]>--- net/unix/af_unix.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)net/unix/af_unix.c +0
-0@@ -80,6 +80,9 @@* with BSD names. */
Quoted 6 lines
net/unix/af_unix.c line 85
Quoted 3 lines
net/unix/af_unix.c +3
-0+#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
Quoted 35 lines
Quoted 23 lines
net/unix/af_unix.c +2
-2#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 }net/unix/af_unix.c static int __init af_unix_init(void) · line 2443
Quoted 9 lines
net/unix/af_unix.c +1
-2@@ -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; }.
Quoted 17 lines · Wang Weidong
Quoted 16 lines · Daniel Borkmann
Quoted 15 lines · Wang Weidong
use pr_<level> instead of printk(LEVEL)
Signed-off-by Wang Weidong <[email protected]>--- net/unix/af_unix.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)net/unix/af_unix.c +0
-0@@ -80,6 +80,9 @@* with BSD names. */
Quoted 7 lines
Quoted 6 lines
net/unix/af_unix.c line 85
Quoted 3 lines
net/unix/af_unix.c +3
-0+#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.
Quoted 24 lines · Daniel Borkmann
Quoted 23 lines · Wang Weidong
Quoted 22 lines · Daniel Borkmann
Quoted 12 lines · Wang Weidong
use pr_<level> instead of printk(LEVEL)
Signed-off-by Wang Weidong <[email protected]>--- net/unix/af_unix.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)net/unix/af_unix.c +0
-0net/unix/af_unix.c line 85
Quoted 6 lines
net/unix/af_unix.c +3
-0@@ -80,6 +80,9 @@* with BSD names. */ +#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#define DEBUG +Why do you define DEBUG here ?
Quoted 8 lines
Quoted 1 line
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.
Quoted 1 line
PATCH v2 1/1 unix: convert printks to pr_<level>
In reply to Wang Weidonguse pr_<level> instead of printk(LEVEL)
--- net/unix/af_unix.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
net/unix/af_unix.c +5 -4
@@ -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; }
Signature · 1 line
1.7.12
From: Wang Weidong <[email protected]>
Date: Fri, 6 Dec 2013 18:03:36 +0800
Quoted 3 lines
use pr_<level> instead of printk(LEVEL)
Signed-off-by Wang Weidong <[email protected]>
Applied, thanks.