From patchwork Tue Dec 17 07:03:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangweidong X-Patchwork-Id: 302027 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 8F67E2C007E for ; Tue, 17 Dec 2013 18:04:37 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752811Ab3LQHEd (ORCPT ); Tue, 17 Dec 2013 02:04:33 -0500 Received: from szxga01-in.huawei.com ([119.145.14.64]:2833 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752574Ab3LQHEd (ORCPT ); Tue, 17 Dec 2013 02:04:33 -0500 Received: from 172.24.2.119 (EHLO szxeml213-edg.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BOP37722; Tue, 17 Dec 2013 15:04:12 +0800 (CST) Received: from SZXEML450-HUB.china.huawei.com (10.82.67.193) by szxeml213-edg.china.huawei.com (172.24.2.30) with Microsoft SMTP Server (TLS) id 14.3.158.1; Tue, 17 Dec 2013 15:03:51 +0800 Received: from localhost (10.135.68.79) by szxeml450-hub.china.huawei.com (10.82.67.193) with Microsoft SMTP Server id 14.3.158.1; Tue, 17 Dec 2013 15:03:48 +0800 From: Wang Weidong To: , , CC: , Subject: [PATCH net-next 1/2] tipc: make the code look more better Date: Tue, 17 Dec 2013 15:03:46 +0800 Message-ID: <1387263827-20876-2-git-send-email-wangweidong1@huawei.com> X-Mailer: git-send-email 1.8.1.msysgit.1 In-Reply-To: <1387263827-20876-1-git-send-email-wangweidong1@huawei.com> References: <1387263827-20876-1-git-send-email-wangweidong1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.135.68.79] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org make the code look more better than commit 0cee6bbe06f does. 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; } /*