Skip to content

Commit

Permalink
asm-generic: fix ffs -Wshadow warning
Browse files Browse the repository at this point in the history
gcc -Wshadow warns about the ffs() definition that has the
same name as the global ffs() built-in:

include/asm-generic/bitops/builtin-ffs.h:13:28: warning: declaration of 'ffs' shadows a built-in function [-Wshadow]

This is annoying because 'make W=2' warns every time this
header gets included.

Change it to use a #define instead, making callers directly
reference the builtin.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Arnd Bergmann committed Oct 26, 2020
1 parent 80b4707 commit 6f6573a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions include/asm-generic/bitops/builtin-ffs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
* the libc and compiler builtin ffs routines, therefore
* differs in spirit from the above ffz (man ffs).
*/
static __always_inline int ffs(int x)
{
return __builtin_ffs(x);
}
#define ffs(x) __builtin_ffs(x)

#endif

0 comments on commit 6f6573a

Please sign in to comment.