From patchwork Thu Dec 19 02:02:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangweidong X-Patchwork-Id: 303139 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 BBA412C00AF for ; Thu, 19 Dec 2013 13:06:30 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752622Ab3LSCG1 (ORCPT ); Wed, 18 Dec 2013 21:06:27 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:30829 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751072Ab3LSCG0 (ORCPT ); Wed, 18 Dec 2013 21:06:26 -0500 Received: from 172.24.2.119 (EHLO szxeml212-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BNJ02836; Thu, 19 Dec 2013 10:05:52 +0800 (CST) Received: from SZXEML406-HUB.china.huawei.com (10.82.67.93) by szxeml212-edg.china.huawei.com (172.24.2.181) with Microsoft SMTP Server (TLS) id 14.3.158.1; Thu, 19 Dec 2013 10:02:49 +0800 Received: from [127.0.0.1] (10.135.68.79) by szxeml406-hub.china.huawei.com (10.82.67.93) with Microsoft SMTP Server id 14.3.158.1; Thu, 19 Dec 2013 10:02:45 +0800 Message-ID: <52B253C2.8070407@huawei.com> Date: Thu, 19 Dec 2013 10:02:42 +0800 From: Wang Weidong User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: David Miller , Vlad Yasevich , Neil Horman CC: , Subject: [PATCH net-next v2] sctp: remove the never used 'return' and redundant 'break' References: <52B168E0.1060108@huawei.com> In-Reply-To: <52B168E0.1060108@huawei.com> 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 In switch() had do return, and never use the 'return NULL'. The 'break' after return or goto has no effect. Remove it. v2: make it more readable as suggested by Neil. Signed-off-by: Wang Weidong Acked-by: Neil Horman --- net/sctp/input.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/net/sctp/input.c b/net/sctp/input.c index 042ec6c..476bc8d 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c @@ -1119,19 +1119,10 @@ static struct sctp_association *__sctp_rcv_lookup_harder(struct net *net, return NULL; /* If this is INIT/INIT-ACK look inside the chunk too. */ - switch (ch->type) { - case SCTP_CID_INIT: - case SCTP_CID_INIT_ACK: + if (ch->type == SCTP_CID_INIT || ch->type == SCTP_CID_INIT_ACK) return __sctp_rcv_init_lookup(net, skb, laddr, transportp); - break; - default: - return __sctp_rcv_walk_lookup(net, skb, laddr, transportp); - break; - } - - - return NULL; + return __sctp_rcv_walk_lookup(net, skb, laddr, transportp); } /* Lookup an association for an inbound skb. */