Skip to content

Commit

Permalink
x86, bitops: Move fls64.h inside __KERNEL__
Browse files Browse the repository at this point in the history
We would include <asm-generic/bitops/fls64.h> even without __KERNEL__,
but that doesn't make sense, as:

1. That file provides fls64(), but the corresponding function fls() is
   not exported to user space.
2. The implementation of fls64.h uses kernel-only symbols.
3. fls64.h is not exported to user space.

This appears to have been a bug introduced in checkin:

d57594c bitops: use __fls for fls64 on 64-bit archs

Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Alexander van Heukelum <heukelum@mailshack.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Link: http://lkml.kernel.org/r/4EEA77E1.6050009@zytor.com
  • Loading branch information
H. Peter Anvin committed Dec 15, 2011
1 parent cebef5b commit 83d99df
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions arch/x86/include/asm/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ static inline unsigned long __fls(unsigned long word)
return word;
}

#undef ADDR

#ifdef __KERNEL__
/**
* ffs - find first set bit in word
Expand Down Expand Up @@ -434,11 +436,6 @@ static inline int fls(int x)
#endif
return r + 1;
}
#endif /* __KERNEL__ */

#undef ADDR

#ifdef __KERNEL__

#include <asm-generic/bitops/find.h>

Expand All @@ -450,12 +447,8 @@ static inline int fls(int x)

#include <asm-generic/bitops/const_hweight.h>

#endif /* __KERNEL__ */

#include <asm-generic/bitops/fls64.h>

#ifdef __KERNEL__

#include <asm-generic/bitops/le.h>

#include <asm-generic/bitops/ext2-atomic-setbit.h>
Expand Down

0 comments on commit 83d99df

Please sign in to comment.