aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/include
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2011-05-26 19:26:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-26 20:12:38 -0400
commita2812e178321132811a53f7be40fe7e9bbffd9e0 (patch)
tree5e1ae6d683d964cce8b4f107d8032522ac69b372 /arch/m68k/include
parente0819410dba141338ebf6ab1057c1863be6247ab (diff)
arch: add #define for each of optimized find bitops
The style that we normally use in asm-generic is to test the macro itself for existence, so in asm-generic, do: #ifndef find_next_zero_bit_le extern unsigned long find_next_zero_bit_le(const void *addr, unsigned long size, unsigned long offset); #endif and in the architectures, write static inline unsigned long find_next_zero_bit_le(const void *addr, unsigned long size, unsigned long offset) #define find_next_zero_bit_le find_next_zero_bit_le This adds the #define for each of the optimized find bitops in the architectures. Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Acked-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Greg Ungerer <gerg@uclinux.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68k/include')
-rw-r--r--arch/m68k/include/asm/bitops_mm.h8
-rw-r--r--arch/m68k/include/asm/bitops_no.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index e9020f88a748..89cf5b814a4d 100644
--- a/arch/m68k/include/asm/bitops_mm.h
+++ b/arch/m68k/include/asm/bitops_mm.h
@@ -200,6 +200,7 @@ out:
200 res += ((long)p - (long)vaddr - 4) * 8; 200 res += ((long)p - (long)vaddr - 4) * 8;
201 return res < size ? res : size; 201 return res < size ? res : size;
202} 202}
203#define find_first_zero_bit find_first_zero_bit
203 204
204static inline int find_next_zero_bit(const unsigned long *vaddr, int size, 205static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
205 int offset) 206 int offset)
@@ -229,6 +230,7 @@ static inline int find_next_zero_bit(const unsigned long *vaddr, int size,
229 /* No zero yet, search remaining full bytes for a zero */ 230 /* No zero yet, search remaining full bytes for a zero */
230 return offset + find_first_zero_bit(p, size - offset); 231 return offset + find_first_zero_bit(p, size - offset);
231} 232}
233#define find_next_zero_bit find_next_zero_bit
232 234
233static inline int find_first_bit(const unsigned long *vaddr, unsigned size) 235static inline int find_first_bit(const unsigned long *vaddr, unsigned size)
234{ 236{
@@ -253,6 +255,7 @@ out:
253 res += ((long)p - (long)vaddr - 4) * 8; 255 res += ((long)p - (long)vaddr - 4) * 8;
254 return res < size ? res : size; 256 return res < size ? res : size;
255} 257}
258#define find_first_bit find_first_bit
256 259
257static inline int find_next_bit(const unsigned long *vaddr, int size, 260static inline int find_next_bit(const unsigned long *vaddr, int size,
258 int offset) 261 int offset)
@@ -282,6 +285,7 @@ static inline int find_next_bit(const unsigned long *vaddr, int size,
282 /* No one yet, search remaining full bytes for a one */ 285 /* No one yet, search remaining full bytes for a one */
283 return offset + find_first_bit(p, size - offset); 286 return offset + find_first_bit(p, size - offset);
284} 287}
288#define find_next_bit find_next_bit
285 289
286/* 290/*
287 * ffz = Find First Zero in word. Undefined if no zero exists, 291 * ffz = Find First Zero in word. Undefined if no zero exists,
@@ -398,6 +402,7 @@ out:
398 res += (p - addr) * 32; 402 res += (p - addr) * 32;
399 return res < size ? res : size; 403 return res < size ? res : size;
400} 404}
405#define find_first_zero_bit_le find_first_zero_bit_le
401 406
402static inline unsigned long find_next_zero_bit_le(const void *addr, 407static inline unsigned long find_next_zero_bit_le(const void *addr,
403 unsigned long size, unsigned long offset) 408 unsigned long size, unsigned long offset)
@@ -427,6 +432,7 @@ static inline unsigned long find_next_zero_bit_le(const void *addr,
427 /* No zero yet, search remaining full bytes for a zero */ 432 /* No zero yet, search remaining full bytes for a zero */
428 return offset + find_first_zero_bit_le(p, size - offset); 433 return offset + find_first_zero_bit_le(p, size - offset);
429} 434}
435#define find_next_zero_bit_le find_next_zero_bit_le
430 436
431static inline int find_first_bit_le(const void *vaddr, unsigned size) 437static inline int find_first_bit_le(const void *vaddr, unsigned size)
432{ 438{
@@ -451,6 +457,7 @@ out:
451 res += (p - addr) * 32; 457 res += (p - addr) * 32;
452 return res < size ? res : size; 458 return res < size ? res : size;
453} 459}
460#define find_first_bit_le find_first_bit_le
454 461
455static inline unsigned long find_next_bit_le(const void *addr, 462static inline unsigned long find_next_bit_le(const void *addr,
456 unsigned long size, unsigned long offset) 463 unsigned long size, unsigned long offset)
@@ -480,6 +487,7 @@ static inline unsigned long find_next_bit_le(const void *addr,
480 /* No set bit yet, search remaining full bytes for a set bit */ 487 /* No set bit yet, search remaining full bytes for a set bit */
481 return offset + find_first_bit_le(p, size - offset); 488 return offset + find_first_bit_le(p, size - offset);
482} 489}
490#define find_next_bit_le find_next_bit_le
483 491
484/* Bitmap functions for the ext2 filesystem. */ 492/* Bitmap functions for the ext2 filesystem. */
485 493
diff --git a/arch/m68k/include/asm/bitops_no.h b/arch/m68k/include/asm/bitops_no.h
index b816299816ad..52793ebc4471 100644
--- a/arch/m68k/include/asm/bitops_no.h
+++ b/arch/m68k/include/asm/bitops_no.h
@@ -319,6 +319,7 @@ found_first:
319found_middle: 319found_middle:
320 return result + ffz(__swab32(tmp)); 320 return result + ffz(__swab32(tmp));
321} 321}
322#define find_next_zero_bit_le find_next_zero_bit_le
322 323
323static inline unsigned long find_next_bit_le(const void *addr, unsigned 324static inline unsigned long find_next_bit_le(const void *addr, unsigned
324 long size, unsigned long offset) 325 long size, unsigned long offset)
@@ -363,6 +364,7 @@ found_middle:
363found_middle_swap: 364found_middle_swap:
364 return result + __ffs(__swab32(tmp)); 365 return result + __ffs(__swab32(tmp));
365} 366}
367#define find_next_bit_le find_next_bit_le
366 368
367#endif /* __KERNEL__ */ 369#endif /* __KERNEL__ */
368 370