aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/sock.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-05-16 15:58:40 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-17 05:00:04 -0400
commite005d193d55ee5f757b13306112d8c23aac27a88 (patch)
tree46a17d725e100c162198bb283581866c9ffa4a47 /net/core/sock.c
parent675418d5187785d3d996ca15fd700f5e02901cbc (diff)
net: core: Use pr_<level>
Use the current logging style. This enables use of dynamic debugging as well. Convert printk(KERN_<LEVEL> to pr_<level>. Add pr_fmt. Remove embedded prefixes, use %s, __func__ instead. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r--net/core/sock.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index 9d144ee7e37..5efcd6307fa 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -89,6 +89,8 @@
89 * 2 of the License, or (at your option) any later version. 89 * 2 of the License, or (at your option) any later version.
90 */ 90 */
91 91
92#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
93
92#include <linux/capability.h> 94#include <linux/capability.h>
93#include <linux/errno.h> 95#include <linux/errno.h>
94#include <linux/types.h> 96#include <linux/types.h>
@@ -297,9 +299,8 @@ static int sock_set_timeout(long *timeo_p, char __user *optval, int optlen)
297 *timeo_p = 0; 299 *timeo_p = 0;
298 if (warned < 10 && net_ratelimit()) { 300 if (warned < 10 && net_ratelimit()) {
299 warned++; 301 warned++;
300 printk(KERN_INFO "sock_set_timeout: `%s' (pid %d) " 302 pr_info("%s: `%s' (pid %d) tries to set negative timeout\n",
301 "tries to set negative timeout\n", 303 __func__, current->comm, task_pid_nr(current));
302 current->comm, task_pid_nr(current));
303 } 304 }
304 return 0; 305 return 0;
305 } 306 }
@@ -317,8 +318,8 @@ static void sock_warn_obsolete_bsdism(const char *name)
317 static char warncomm[TASK_COMM_LEN]; 318 static char warncomm[TASK_COMM_LEN];
318 if (strcmp(warncomm, current->comm) && warned < 5) { 319 if (strcmp(warncomm, current->comm) && warned < 5) {
319 strcpy(warncomm, current->comm); 320 strcpy(warncomm, current->comm);
320 printk(KERN_WARNING "process `%s' is using obsolete " 321 pr_warn("process `%s' is using obsolete %s SO_BSDCOMPAT\n",
321 "%s SO_BSDCOMPAT\n", warncomm, name); 322 warncomm, name);
322 warned++; 323 warned++;
323 } 324 }
324} 325}
@@ -1238,8 +1239,8 @@ static void __sk_free(struct sock *sk)
1238 sock_disable_timestamp(sk, SK_FLAGS_TIMESTAMP); 1239 sock_disable_timestamp(sk, SK_FLAGS_TIMESTAMP);
1239 1240
1240 if (atomic_read(&sk->sk_omem_alloc)) 1241 if (atomic_read(&sk->sk_omem_alloc))
1241 printk(KERN_DEBUG "%s: optmem leakage (%d bytes) detected.\n", 1242 pr_debug("%s: optmem leakage (%d bytes) detected\n",
1242 __func__, atomic_read(&sk->sk_omem_alloc)); 1243 __func__, atomic_read(&sk->sk_omem_alloc));
1243 1244
1244 if (sk->sk_peer_cred) 1245 if (sk->sk_peer_cred)
1245 put_cred(sk->sk_peer_cred); 1246 put_cred(sk->sk_peer_cred);
@@ -2424,7 +2425,7 @@ static void assign_proto_idx(struct proto *prot)
2424 prot->inuse_idx = find_first_zero_bit(proto_inuse_idx, PROTO_INUSE_NR); 2425 prot->inuse_idx = find_first_zero_bit(proto_inuse_idx, PROTO_INUSE_NR);
2425 2426
2426 if (unlikely(prot->inuse_idx == PROTO_INUSE_NR - 1)) { 2427 if (unlikely(prot->inuse_idx == PROTO_INUSE_NR - 1)) {
2427 printk(KERN_ERR "PROTO_INUSE_NR exhausted\n"); 2428 pr_err("PROTO_INUSE_NR exhausted\n");
2428 return; 2429 return;
2429 } 2430 }
2430 2431
@@ -2454,8 +2455,8 @@ int proto_register(struct proto *prot, int alloc_slab)
2454 NULL); 2455 NULL);
2455 2456
2456 if (prot->slab == NULL) { 2457 if (prot->slab == NULL) {
2457 printk(KERN_CRIT "%s: Can't create sock SLAB cache!\n", 2458 pr_crit("%s: Can't create sock SLAB cache!\n",
2458 prot->name); 2459 prot->name);
2459 goto out; 2460 goto out;
2460 } 2461 }
2461 2462
@@ -2469,8 +2470,8 @@ int proto_register(struct proto *prot, int alloc_slab)
2469 SLAB_HWCACHE_ALIGN, NULL); 2470 SLAB_HWCACHE_ALIGN, NULL);
2470 2471
2471 if (prot->rsk_prot->slab == NULL) { 2472 if (prot->rsk_prot->slab == NULL) {
2472 printk(KERN_CRIT "%s: Can't create request sock SLAB cache!\n", 2473 pr_crit("%s: Can't create request sock SLAB cache!\n",
2473 prot->name); 2474 prot->name);
2474 goto out_free_request_sock_slab_name; 2475 goto out_free_request_sock_slab_name;
2475 } 2476 }
2476 } 2477 }