aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwangweidong <wangweidong1@huawei.com>2013-10-26 04:06:32 -0400
committerDavid S. Miller <davem@davemloft.net>2013-10-28 01:02:34 -0400
commit747edc0f9ea6041128fe5ff8dda57634feb2a723 (patch)
treee9a067fbabe1a021b11ed2fc427f1dc5003cfb22
parent3dc0a548a096c67e91ef3d8f6ca39466058b1725 (diff)
sctp: merge two if statements to one
Two if statements do the same work, we can merge them to one. And fix some typos. There is just code simplification, no functional changes. Signed-off-by: Wang Weidong <wangweidong1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/sctp/auth.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/net/sctp/auth.c b/net/sctp/auth.c
index 8c4fa5dec824..46b5977978a1 100644
--- a/net/sctp/auth.c
+++ b/net/sctp/auth.c
@@ -539,18 +539,14 @@ struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct sctp_association *asoc)
539 for (i = 0; i < n_elt; i++) { 539 for (i = 0; i < n_elt; i++) {
540 id = ntohs(hmacs->hmac_ids[i]); 540 id = ntohs(hmacs->hmac_ids[i]);
541 541
542 /* Check the id is in the supported range */ 542 /* Check the id is in the supported range. And
543 if (id > SCTP_AUTH_HMAC_ID_MAX) { 543 * see if we support the id. Supported IDs have name and
544 id = 0; 544 * length fields set, so that we can allocate and use
545 continue;
546 }
547
548 /* See is we support the id. Supported IDs have name and
549 * length fields set, so that we can allocated and use
550 * them. We can safely just check for name, for without the 545 * them. We can safely just check for name, for without the
551 * name, we can't allocate the TFM. 546 * name, we can't allocate the TFM.
552 */ 547 */
553 if (!sctp_hmac_list[id].hmac_name) { 548 if (id > SCTP_AUTH_HMAC_ID_MAX ||
549 !sctp_hmac_list[id].hmac_name) {
554 id = 0; 550 id = 0;
555 continue; 551 continue;
556 } 552 }