|
@@ -89,6 +89,8 @@
|
|
|
* 2 of the License, or (at your option) any later version.
|
|
|
*/
|
|
|
|
|
|
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
|
|
+
|
|
|
#include <linux/capability.h>
|
|
|
#include <linux/errno.h>
|
|
|
#include <linux/types.h>
|
|
@@ -297,9 +299,8 @@ static int sock_set_timeout(long *timeo_p, char __user *optval, int optlen)
|
|
|
*timeo_p = 0;
|
|
|
if (warned < 10 && net_ratelimit()) {
|
|
|
warned++;
|
|
|
- printk(KERN_INFO "sock_set_timeout: `%s' (pid %d) "
|
|
|
- "tries to set negative timeout\n",
|
|
|
- current->comm, task_pid_nr(current));
|
|
|
+ pr_info("%s: `%s' (pid %d) tries to set negative timeout\n",
|
|
|
+ __func__, current->comm, task_pid_nr(current));
|
|
|
}
|
|
|
return 0;
|
|
|
}
|
|
@@ -317,8 +318,8 @@ static void sock_warn_obsolete_bsdism(const char *name)
|
|
|
static char warncomm[TASK_COMM_LEN];
|
|
|
if (strcmp(warncomm, current->comm) && warned < 5) {
|
|
|
strcpy(warncomm, current->comm);
|
|
|
- printk(KERN_WARNING "process `%s' is using obsolete "
|
|
|
- "%s SO_BSDCOMPAT\n", warncomm, name);
|
|
|
+ pr_warn("process `%s' is using obsolete %s SO_BSDCOMPAT\n",
|
|
|
+ warncomm, name);
|
|
|
warned++;
|
|
|
}
|
|
|
}
|
|
@@ -1238,8 +1239,8 @@ static void __sk_free(struct sock *sk)
|
|
|
sock_disable_timestamp(sk, SK_FLAGS_TIMESTAMP);
|
|
|
|
|
|
if (atomic_read(&sk->sk_omem_alloc))
|
|
|
- printk(KERN_DEBUG "%s: optmem leakage (%d bytes) detected.\n",
|
|
|
- __func__, atomic_read(&sk->sk_omem_alloc));
|
|
|
+ pr_debug("%s: optmem leakage (%d bytes) detected\n",
|
|
|
+ __func__, atomic_read(&sk->sk_omem_alloc));
|
|
|
|
|
|
if (sk->sk_peer_cred)
|
|
|
put_cred(sk->sk_peer_cred);
|
|
@@ -2424,7 +2425,7 @@ static void assign_proto_idx(struct proto *prot)
|
|
|
prot->inuse_idx = find_first_zero_bit(proto_inuse_idx, PROTO_INUSE_NR);
|
|
|
|
|
|
if (unlikely(prot->inuse_idx == PROTO_INUSE_NR - 1)) {
|
|
|
- printk(KERN_ERR "PROTO_INUSE_NR exhausted\n");
|
|
|
+ pr_err("PROTO_INUSE_NR exhausted\n");
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -2454,8 +2455,8 @@ int proto_register(struct proto *prot, int alloc_slab)
|
|
|
NULL);
|
|
|
|
|
|
if (prot->slab == NULL) {
|
|
|
- printk(KERN_CRIT "%s: Can't create sock SLAB cache!\n",
|
|
|
- prot->name);
|
|
|
+ pr_crit("%s: Can't create sock SLAB cache!\n",
|
|
|
+ prot->name);
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
@@ -2469,8 +2470,8 @@ int proto_register(struct proto *prot, int alloc_slab)
|
|
|
SLAB_HWCACHE_ALIGN, NULL);
|
|
|
|
|
|
if (prot->rsk_prot->slab == NULL) {
|
|
|
- printk(KERN_CRIT "%s: Can't create request sock SLAB cache!\n",
|
|
|
- prot->name);
|
|
|
+ pr_crit("%s: Can't create request sock SLAB cache!\n",
|
|
|
+ prot->name);
|
|
|
goto out_free_request_sock_slab_name;
|
|
|
}
|
|
|
}
|