summaryrefslogtreecommitdiffstats
path: root/net/tipc/port.c
diff options
context:
space:
mode:
authorwangweidong <wangweidong1@huawei.com>2013-12-12 09:36:39 +0800
committerDavid S. Miller <davem@davemloft.net>2013-12-16 12:48:35 -0500
commit0cee6bbe06f67ff7dd83a4bc794f23c5cd5e7929 (patch)
tree59864290d3b49dbf64e42c53030e883461125998 /net/tipc/port.c
parent810c23a3553cbb4602edf9534b548d2616ba5520 (diff)
downloadlinux-stable-0cee6bbe06f67ff7dd83a4bc794f23c5cd5e7929.tar.gz
linux-stable-0cee6bbe06f67ff7dd83a4bc794f23c5cd5e7929.tar.bz2
linux-stable-0cee6bbe06f67ff7dd83a4bc794f23c5cd5e7929.zip
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/port.c')
-rw-r--r--net/tipc/port.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/tipc/port.c b/net/tipc/port.c
index c081a7632302..5fd4c8cec08e 100644
--- a/net/tipc/port.c
+++ b/net/tipc/port.c
@@ -832,17 +832,14 @@ exit:
*/
int __tipc_disconnect(struct tipc_port *tp_ptr)
{
- int res;
-
if (tp_ptr->connected) {
tp_ptr->connected = 0;
/* let timer expire on it's own to avoid deadlock! */
tipc_nodesub_unsubscribe(&tp_ptr->subscription);
- res = 0;
- } else {
- res = -ENOTCONN;
+ return 0;
}
- return res;
+
+ return -ENOTCONN;
}
/*