diff options
author | Jean Sacren <sakiwit@gmail.com> | 2013-02-03 16:34:10 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-04 13:26:49 -0500 |
commit | 56db1c5f41c2ed0300ca570fea279a7c189c18fb (patch) | |
tree | 0ee62cc32f182250f65e9bcb1f5ea8c23e512de7 /net | |
parent | 25cc4ae913a46bcc11b03c37bec59568f2122a36 (diff) |
mcast: do not check 'rv' twice in a row
With the loop, don't check 'rv' twice in a row. Without the loop, 'rv'
doesn't even need to be checked.
Make the comment more grammar-friendly.
Signed-off-by: Jean Sacren <sakiwit@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/mcast.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 8460a1f54a76..e5de48551864 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -427,11 +427,9 @@ int ip6_mc_source(int add, int omode, struct sock *sk, | |||
427 | rv = 1; /* > 0 for insert logic below if sl_count is 0 */ | 427 | rv = 1; /* > 0 for insert logic below if sl_count is 0 */ |
428 | for (i=0; i<psl->sl_count; i++) { | 428 | for (i=0; i<psl->sl_count; i++) { |
429 | rv = !ipv6_addr_equal(&psl->sl_addr[i], source); | 429 | rv = !ipv6_addr_equal(&psl->sl_addr[i], source); |
430 | if (rv == 0) | 430 | if (rv == 0) /* There is an error in the address. */ |
431 | break; | 431 | goto done; |
432 | } | 432 | } |
433 | if (rv == 0) /* address already there is an error */ | ||
434 | goto done; | ||
435 | for (j=psl->sl_count-1; j>=i; j--) | 433 | for (j=psl->sl_count-1; j>=i; j--) |
436 | psl->sl_addr[j+1] = psl->sl_addr[j]; | 434 | psl->sl_addr[j+1] = psl->sl_addr[j]; |
437 | psl->sl_addr[i] = *source; | 435 | psl->sl_addr[i] = *source; |