Skip to content

Commit

Permalink
mcast: do not check 'rv' twice in a row
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jean Sacren authored and David S. Miller committed Feb 4, 2013
1 parent 25cc4ae commit 56db1c5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/ipv6/mcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,9 @@ int ip6_mc_source(int add, int omode, struct sock *sk,
rv = 1; /* > 0 for insert logic below if sl_count is 0 */
for (i=0; i<psl->sl_count; i++) {
rv = !ipv6_addr_equal(&psl->sl_addr[i], source);
if (rv == 0)
break;
if (rv == 0) /* There is an error in the address. */
goto done;
}
if (rv == 0) /* address already there is an error */
goto done;
for (j=psl->sl_count-1; j>=i; j--)
psl->sl_addr[j+1] = psl->sl_addr[j];
psl->sl_addr[i] = *source;
Expand Down

0 comments on commit 56db1c5

Please sign in to comment.