From patchwork Wed Dec 25 02:11:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangweidong X-Patchwork-Id: 305062 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5FD4A2C00BB for ; Wed, 25 Dec 2013 13:12:02 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751317Ab3LYCL4 (ORCPT ); Tue, 24 Dec 2013 21:11:56 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:9585 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751235Ab3LYCLk (ORCPT ); Tue, 24 Dec 2013 21:11:40 -0500 Received: from 172.24.2.119 (EHLO szxeml214-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BNQ32425; Wed, 25 Dec 2013 10:11:23 +0800 (CST) Received: from SZXEML423-HUB.china.huawei.com (10.82.67.162) by szxeml214-edg.china.huawei.com (172.24.2.29) with Microsoft SMTP Server (TLS) id 14.3.158.1; Wed, 25 Dec 2013 10:11:23 +0800 Received: from localhost (10.177.18.75) by szxeml423-hub.china.huawei.com (10.82.67.162) with Microsoft SMTP Server id 14.3.158.1; Wed, 25 Dec 2013 10:11:17 +0800 From: Wang Weidong To: , , CC: , Subject: [PATCH net-next v2 1/2] tipc: make the code look more better Date: Wed, 25 Dec 2013 10:11:12 +0800 Message-ID: <1387937473-5804-2-git-send-email-wangweidong1@huawei.com> X-Mailer: git-send-email 1.8.1.msysgit.1 In-Reply-To: <1387937473-5804-1-git-send-email-wangweidong1@huawei.com> References: <1387937473-5804-1-git-send-email-wangweidong1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.18.75] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In commit 0cee6bbe06f ("tipc: remove unnecessary variables and conditions") didn't make the code look best. So fix it. This patch is cosmetic and does not change the operation of TIPC in any way. Suggested-by: David Laight Signed-off-by: Wang Weidong --- net/tipc/port.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/net/tipc/port.c b/net/tipc/port.c index 5fd4c8c..ee81be0 100644 --- a/net/tipc/port.c +++ b/net/tipc/port.c @@ -832,14 +832,13 @@ exit: */ int __tipc_disconnect(struct tipc_port *tp_ptr) { - if (tp_ptr->connected) { - tp_ptr->connected = 0; - /* let timer expire on it's own to avoid deadlock! */ - tipc_nodesub_unsubscribe(&tp_ptr->subscription); - return 0; - } + if (!tp_ptr->connected) + return -ENOTCONN; - return -ENOTCONN; + tp_ptr->connected = 0; + /* let timer expire on it's own to avoid deadlock! */ + tipc_nodesub_unsubscribe(&tp_ptr->subscription); + return 0; } /*