aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r--net/unix/af_unix.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index a427623ee574..ce6ec6c2f4de 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -80,6 +80,8 @@
80 * with BSD names. 80 * with BSD names.
81 */ 81 */
82 82
83#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
84
83#include <linux/module.h> 85#include <linux/module.h>
84#include <linux/kernel.h> 86#include <linux/kernel.h>
85#include <linux/signal.h> 87#include <linux/signal.h>
@@ -161,9 +163,8 @@ static inline void unix_set_secdata(struct scm_cookie *scm, struct sk_buff *skb)
161 163
162static inline unsigned int unix_hash_fold(__wsum n) 164static inline unsigned int unix_hash_fold(__wsum n)
163{ 165{
164 unsigned int hash = (__force unsigned int)n; 166 unsigned int hash = (__force unsigned int)csum_fold(n);
165 167
166 hash ^= hash>>16;
167 hash ^= hash>>8; 168 hash ^= hash>>8;
168 return hash&(UNIX_HASH_SIZE-1); 169 return hash&(UNIX_HASH_SIZE-1);
169} 170}
@@ -366,7 +367,7 @@ static void unix_sock_destructor(struct sock *sk)
366 WARN_ON(!sk_unhashed(sk)); 367 WARN_ON(!sk_unhashed(sk));
367 WARN_ON(sk->sk_socket); 368 WARN_ON(sk->sk_socket);
368 if (!sock_flag(sk, SOCK_DEAD)) { 369 if (!sock_flag(sk, SOCK_DEAD)) {
369 printk(KERN_INFO "Attempt to release alive unix socket: %p\n", sk); 370 pr_info("Attempt to release alive unix socket: %p\n", sk);
370 return; 371 return;
371 } 372 }
372 373
@@ -378,7 +379,7 @@ static void unix_sock_destructor(struct sock *sk)
378 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1); 379 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
379 local_bh_enable(); 380 local_bh_enable();
380#ifdef UNIX_REFCNT_DEBUG 381#ifdef UNIX_REFCNT_DEBUG
381 printk(KERN_DEBUG "UNIX %p is destroyed, %ld are still alive.\n", sk, 382 pr_debug("UNIX %p is destroyed, %ld are still alive.\n", sk,
382 atomic_long_read(&unix_nr_socks)); 383 atomic_long_read(&unix_nr_socks));
383#endif 384#endif
384} 385}
@@ -1448,7 +1449,7 @@ static int unix_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
1448 struct sock *sk = sock->sk; 1449 struct sock *sk = sock->sk;
1449 struct net *net = sock_net(sk); 1450 struct net *net = sock_net(sk);
1450 struct unix_sock *u = unix_sk(sk); 1451 struct unix_sock *u = unix_sk(sk);
1451 struct sockaddr_un *sunaddr = msg->msg_name; 1452 DECLARE_SOCKADDR(struct sockaddr_un *, sunaddr, msg->msg_name);
1452 struct sock *other = NULL; 1453 struct sock *other = NULL;
1453 int namelen = 0; /* fake GCC */ 1454 int namelen = 0; /* fake GCC */
1454 int err; 1455 int err;
@@ -1910,7 +1911,7 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
1910 struct scm_cookie tmp_scm; 1911 struct scm_cookie tmp_scm;
1911 struct sock *sk = sock->sk; 1912 struct sock *sk = sock->sk;
1912 struct unix_sock *u = unix_sk(sk); 1913 struct unix_sock *u = unix_sk(sk);
1913 struct sockaddr_un *sunaddr = msg->msg_name; 1914 DECLARE_SOCKADDR(struct sockaddr_un *, sunaddr, msg->msg_name);
1914 int copied = 0; 1915 int copied = 0;
1915 int check_creds = 0; 1916 int check_creds = 0;
1916 int target; 1917 int target;
@@ -2441,8 +2442,7 @@ static int __init af_unix_init(void)
2441 2442
2442 rc = proto_register(&unix_proto, 1); 2443 rc = proto_register(&unix_proto, 1);
2443 if (rc != 0) { 2444 if (rc != 0) {
2444 printk(KERN_CRIT "%s: Cannot create unix_sock SLAB cache!\n", 2445 pr_crit("%s: Cannot create unix_sock SLAB cache!\n", __func__);
2445 __func__);
2446 goto out; 2446 goto out;
2447 } 2447 }
2448 2448