diff options
author | wangweidong <wangweidong1@huawei.com> | 2013-12-11 20:36:39 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-16 12:48:35 -0500 |
commit | 0cee6bbe06f67ff7dd83a4bc794f23c5cd5e7929 (patch) | |
tree | 59864290d3b49dbf64e42c53030e883461125998 /net/tipc/socket.c | |
parent | 810c23a3553cbb4602edf9534b548d2616ba5520 (diff) |
tipc: remove unnecessary variables and conditions
We remove a number of unnecessary variables and branches
in TIPC. This patch is cosmetic and does not change the
operation of TIPC in any way.
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r-- | net/tipc/socket.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 3b61851bb927..32037c57937d 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -239,7 +239,6 @@ static int tipc_sk_create(struct net *net, struct socket *sock, int protocol, | |||
239 | int tipc_sock_create_local(int type, struct socket **res) | 239 | int tipc_sock_create_local(int type, struct socket **res) |
240 | { | 240 | { |
241 | int rc; | 241 | int rc; |
242 | struct sock *sk; | ||
243 | 242 | ||
244 | rc = sock_create_lite(AF_TIPC, type, 0, res); | 243 | rc = sock_create_lite(AF_TIPC, type, 0, res); |
245 | if (rc < 0) { | 244 | if (rc < 0) { |
@@ -248,8 +247,6 @@ int tipc_sock_create_local(int type, struct socket **res) | |||
248 | } | 247 | } |
249 | tipc_sk_create(&init_net, *res, 0, 1); | 248 | tipc_sk_create(&init_net, *res, 0, 1); |
250 | 249 | ||
251 | sk = (*res)->sk; | ||
252 | |||
253 | return 0; | 250 | return 0; |
254 | } | 251 | } |
255 | 252 | ||
@@ -1311,14 +1308,12 @@ static u32 filter_connect(struct tipc_sock *tsock, struct sk_buff **buf) | |||
1311 | static unsigned int rcvbuf_limit(struct sock *sk, struct sk_buff *buf) | 1308 | static unsigned int rcvbuf_limit(struct sock *sk, struct sk_buff *buf) |
1312 | { | 1309 | { |
1313 | struct tipc_msg *msg = buf_msg(buf); | 1310 | struct tipc_msg *msg = buf_msg(buf); |
1314 | unsigned int limit; | ||
1315 | 1311 | ||
1316 | if (msg_connected(msg)) | 1312 | if (msg_connected(msg)) |
1317 | limit = sysctl_tipc_rmem[2]; | 1313 | return sysctl_tipc_rmem[2]; |
1318 | else | 1314 | |
1319 | limit = sk->sk_rcvbuf >> TIPC_CRITICAL_IMPORTANCE << | 1315 | return sk->sk_rcvbuf >> TIPC_CRITICAL_IMPORTANCE << |
1320 | msg_importance(msg); | 1316 | msg_importance(msg); |
1321 | return limit; | ||
1322 | } | 1317 | } |
1323 | 1318 | ||
1324 | /** | 1319 | /** |