Commit 96b8d4c19d797200b973caab57ca842531184c13

Authored by Rusty Russell
1 parent 165ac433fa

avr32: define __fls

Like fls, but can't be handed 0 and returns the bit number.

(I broke this arch in linux-next by using __fls in generic code).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

arch/avr32/include/asm/bitops.h
... ... @@ -263,6 +263,11 @@
263 263 return 32 - result;
264 264 }
265 265  
  266 +static inline int __fls(unsigned long word)
  267 +{
  268 + return fls(word) - 1;
  269 +}
  270 +
266 271 unsigned long find_first_zero_bit(const unsigned long *addr,
267 272 unsigned long size);
268 273 unsigned long find_next_zero_bit(const unsigned long *addr,