Skip to content

Commit

Permalink
m68k: bitops - offset == ((long)p - (long)vaddr) * 8
Browse files Browse the repository at this point in the history
Hence use "offset" in find_next_{,zero_}bit(), like is already done for
find_next_{,zero_}bit_le()

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
  • Loading branch information
Geert Uytterhoeven committed May 19, 2011
1 parent 61c4f2c commit 359c47e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions arch/m68k/include/asm/bitops_mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@ static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
offset += 32;
}
/* No zero yet, search remaining full bytes for a zero */
res = find_first_zero_bit(p, size - ((long)p - (long)vaddr) * 8);
return offset + res;
return offset + find_first_zero_bit(p, size - offset);
}

static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
Expand Down Expand Up @@ -267,8 +266,7 @@ static inline int find_next_bit(const unsigned long *vaddr, int size,
offset += 32;
}
/* No one yet, search remaining full bytes for a one */
res = find_first_bit(p, size - ((long)p - (long)vaddr) * 8);
return offset + res;
return offset + find_first_bit(p, size - offset);
}

/*
Expand Down

0 comments on commit 359c47e

Please sign in to comment.