diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2011-03-23 19:41:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-23 22:46:12 -0400 |
commit | a56560b3b233238e85205d4e8d7bded904ac2306 (patch) | |
tree | 3965be2ab5fcf6c70fc09604861c14ef554915e8 /lib | |
parent | c4945b9ed472e8796e352f10df9dbc2841ba7b61 (diff) |
asm-generic: change little-endian bitops to take any pointer types
This makes the little-endian bitops take any pointer types by changing the
prototypes and adding casts in the preprocessor macros.
That would seem to at least make all the filesystem code happier, and they
can continue to do just something like
#define ext2_set_bit __test_and_set_bit_le
(or whatever the exact sequence ends up being).
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Mikael Starvik <starvik@axis.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Matthew Wilcox <willy@debian.org>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Kazumoto Kojima <kkojima@rr.iij4u.or.jp>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Chris Zankel <chris@zankel.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/find_next_bit.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/find_next_bit.c b/lib/find_next_bit.c index c093ba988003..7667c3d907d3 100644 --- a/lib/find_next_bit.c +++ b/lib/find_next_bit.c | |||
@@ -185,15 +185,16 @@ static inline unsigned long ext2_swab(const unsigned long y) | |||
185 | #endif | 185 | #endif |
186 | } | 186 | } |
187 | 187 | ||
188 | unsigned long find_next_zero_bit_le(const unsigned long *addr, unsigned | 188 | unsigned long find_next_zero_bit_le(const void *addr, unsigned |
189 | long size, unsigned long offset) | 189 | long size, unsigned long offset) |
190 | { | 190 | { |
191 | const unsigned long *p = addr + BITOP_WORD(offset); | 191 | const unsigned long *p = addr; |
192 | unsigned long result = offset & ~(BITS_PER_LONG - 1); | 192 | unsigned long result = offset & ~(BITS_PER_LONG - 1); |
193 | unsigned long tmp; | 193 | unsigned long tmp; |
194 | 194 | ||
195 | if (offset >= size) | 195 | if (offset >= size) |
196 | return size; | 196 | return size; |
197 | p += BITOP_WORD(offset); | ||
197 | size -= result; | 198 | size -= result; |
198 | offset &= (BITS_PER_LONG - 1UL); | 199 | offset &= (BITS_PER_LONG - 1UL); |
199 | if (offset) { | 200 | if (offset) { |
@@ -228,15 +229,16 @@ found_middle_swap: | |||
228 | } | 229 | } |
229 | EXPORT_SYMBOL(find_next_zero_bit_le); | 230 | EXPORT_SYMBOL(find_next_zero_bit_le); |
230 | 231 | ||
231 | unsigned long find_next_bit_le(const unsigned long *addr, unsigned | 232 | unsigned long find_next_bit_le(const void *addr, unsigned |
232 | long size, unsigned long offset) | 233 | long size, unsigned long offset) |
233 | { | 234 | { |
234 | const unsigned long *p = addr + BITOP_WORD(offset); | 235 | const unsigned long *p = addr; |
235 | unsigned long result = offset & ~(BITS_PER_LONG - 1); | 236 | unsigned long result = offset & ~(BITS_PER_LONG - 1); |
236 | unsigned long tmp; | 237 | unsigned long tmp; |
237 | 238 | ||
238 | if (offset >= size) | 239 | if (offset >= size) |
239 | return size; | 240 | return size; |
241 | p += BITOP_WORD(offset); | ||
240 | size -= result; | 242 | size -= result; |
241 | offset &= (BITS_PER_LONG - 1UL); | 243 | offset &= (BITS_PER_LONG - 1UL); |
242 | if (offset) { | 244 | if (offset) { |