Remove "#define unlikely(cond) (cond)"
PATCH 1/1 Remove "#define unlikely(cond) (cond)"
commit c104c16073b7fdb3e4eae18f66f4009f6b073d6f
Author: Sergio González Collado <[email protected]> Date: Sun Mar 2 23:15:18 2025 +0100
Kunit to check the longest symbol length
included <linux/kallsyms.h> which triggered
arch/x86/tools/insn_decoder_test.c:15:9: warning: "unlikely" redefined
15 | #define unlikely(cond) (cond)
| ^~~~~~~~
In file included from ./tools/include/linux/build_bug.h:5,
from ./tools/include/linux/kernel.h:8,
from ./tools/include/linux/kallsyms.h:5,
from arch/x86/tools/insn_decoder_test.c:13:./tools/include/linux/compiler.h:128:10: note: this is the location of the previous definition
128 | # define unlikely(x) __builtin_expect(!!(x), 0)
Remove "#define unlikely(cond) (cond)" to silence the compiler warning.
--- arch/x86/tools/insn_decoder_test.c | 2 -- 1 file changed, 2 deletions(-)
arch/x86/tools/insn_decoder_test.c +0 -2
@@ -12,8 +12,6 @@#include <stdarg.h> #include <linux/kallsyms.h> -#define unlikely (cond) (cond) -#include <asm/insn.h> #include <inat.c> #include <insn.c>
Signature · 1 line
2.49.0
Quoted 30 lines · H.J. Lu
commit
c104c16073b7fdb3e4eae18f66f4009f6b073d6fAuthor: Sergio González Collado <[email protected]> Date: Sun Mar 2 23:15:18 2025 +0100Kunit to check the longest symbol length
included <
linux/kallsyms.h> which triggered
arch/x86/tools/insn_decoder_test.c:15:9: warning: "unlikely" redefined
15 | #define unlikely(cond) (cond)
| ^~~~~~~~
In file included from./tools/include/linux/build_bug.h:5,from ./tools/include/linux/kernel.h:8, from ./tools/include/linux/kallsyms.h:5, from arch/x86/tools/insn_decoder_test.c:13:
./tools/include/linux/compiler.h:128:10: note: this is the location of the previous definition
128 | # define unlikely(x)__builtin_expect(!!(x), 0)Remove "#define unlikely(cond) (cond)" to silence the compiler warning.
Signed-off-by H.J. Lu <[email protected]>--- arch/x86/tools/insn_decoder_test.c | 2 -- 1 file changed, 2 deletions(-)arch/x86/tools/insn_decoder_test.c +0
-0
arch/x86/tools/insn_decoder_test.c line 17
Quoted 8 lines
arch/x86/tools/insn_decoder_test.c +0
-2@@ -12,8 +12,6 @@#include <stdarg.h> #include <linux/kallsyms.h> -#define unlikely (cond) (cond) -#include <asm/insn.h> #include <inat.c> #include <insn.c>
Sorry I didn't notice when I suggested to submit, but this same patch was submitted a week ago.