Skip to content

Commit f482f2f

Browse files
wangweidongdavem330
authored andcommitted
sctp: remove the never used 'return' and redundant 'break'
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 <wangweidong1@huawei.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2cc33c7 commit f482f2f

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

‎net/sctp/input.c‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,19 +1116,10 @@ static struct sctp_association *__sctp_rcv_lookup_harder(struct net *net,
11161116
return NULL;
11171117

11181118
/* If this is INIT/INIT-ACK look inside the chunk too. */
1119-
switch (ch->type) {
1120-
case SCTP_CID_INIT:
1121-
case SCTP_CID_INIT_ACK:
1119+
if (ch->type == SCTP_CID_INIT || ch->type == SCTP_CID_INIT_ACK)
11221120
return __sctp_rcv_init_lookup(net, skb, laddr, transportp);
1123-
break;
11241121

1125-
default:
1126-
return __sctp_rcv_walk_lookup(net, skb, laddr, transportp);
1127-
break;
1128-
}
1129-
1130-
1131-
return NULL;
1122+
return __sctp_rcv_walk_lookup(net, skb, laddr, transportp);
11321123
}
11331124

11341125
/* Lookup an association for an inbound skb. */

0 commit comments

Comments
 (0)