From: Arnd Bergmann <arnd(a)arndb.de>
mainline inclusion
from mainline-v5.11
commit 6f6573a4044adefbd07f1bd951a2041150e888d7
category: bugfix
issue: #I4LRGQ
Reference:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?…
-------------------------------------------------
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(a)arndb.de>
Signed-off-by: Zhang Jianhua <chris.zjh(a)huawei.com>
Reviewed-by: He Ying <heying24(a)huawei.com>
Signed-off-by: Chen Jun <chenjun102(a)huawei.com>
Signed-off-by: Zheng Zengkai <zhengzengkai(a)huawei.com>
Signed-off-by: Yu Changchun <yuchangchun1(a)huawei.com>
---
include/asm-generic/bitops/builtin-ffs.h | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/include/asm-generic/bitops/builtin-ffs.h
b/include/asm-generic/bitops/builtin-ffs.h
index 458c85ebcd15..1dacfdb4247e 100644
--- a/include/asm-generic/bitops/builtin-ffs.h
+++ b/include/asm-generic/bitops/builtin-ffs.h
@@ -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
--
2.25.1