Skip to content

Commit 99e4e11

Browse files
committed
tools/include: Sync asm-generic/bitops/fls.h with the kernel sources
To pick up the changes from: cb4ede9 ("riscv: Avoid code duplication with generic bitops implementation") This should address these tools/perf build warnings: Warning: Kernel ABI header differences: diff -u tools/include/asm-generic/bitops/__fls.h include/asm-generic/bitops/__fls.h diff -u tools/include/asm-generic/bitops/fls.h include/asm-generic/bitops/fls.h Cc: Arnd Bergmann <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: [email protected] Signed-off-by: Namhyung Kim <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c781a72 commit 99e4e11

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

tools/include/asm-generic/bitops/__fls.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
#include <asm/types.h>
66

77
/**
8-
* __fls - find last (most-significant) set bit in a long word
8+
* generic___fls - find last (most-significant) set bit in a long word
99
* @word: the word to search
1010
*
1111
* Undefined if no set bit exists, so code should check against 0 first.
1212
*/
13-
static __always_inline unsigned long __fls(unsigned long word)
13+
static __always_inline unsigned long generic___fls(unsigned long word)
1414
{
1515
int num = BITS_PER_LONG - 1;
1616

@@ -41,4 +41,8 @@ static __always_inline unsigned long __fls(unsigned long word)
4141
return num;
4242
}
4343

44+
#ifndef __HAVE_ARCH___FLS
45+
#define __fls(word) generic___fls(word)
46+
#endif
47+
4448
#endif /* _ASM_GENERIC_BITOPS___FLS_H_ */

tools/include/asm-generic/bitops/fls.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
#define _ASM_GENERIC_BITOPS_FLS_H_
44

55
/**
6-
* fls - find last (most-significant) bit set
6+
* generic_fls - find last (most-significant) bit set
77
* @x: the word to search
88
*
99
* This is defined the same way as ffs.
1010
* Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
1111
*/
1212

13-
static __always_inline int fls(unsigned int x)
13+
static __always_inline int generic_fls(unsigned int x)
1414
{
1515
int r = 32;
1616

@@ -39,4 +39,8 @@ static __always_inline int fls(unsigned int x)
3939
return r;
4040
}
4141

42+
#ifndef __HAVE_ARCH_FLS
43+
#define fls(x) generic_fls(x)
44+
#endif
45+
4246
#endif /* _ASM_GENERIC_BITOPS_FLS_H_ */

0 commit comments

Comments
 (0)