[PATCH] Remove "#define unlikely(cond) (cond)"
From: H.J. Lu
Date: Tue Apr 01 2025 - 17:14:35 EST
commit c104c16073b7fdb3e4eae18f66f4009f6b073d6f
Author: Sergio González Collado <sergio.collado@xxxxxxxxx>
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.
Signed-off-by: H.J. Lu <hjl.tools@xxxxxxxxx>
---
arch/x86/tools/insn_decoder_test.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/x86/tools/insn_decoder_test.c b/arch/x86/tools/insn_decoder_test.c
index 6c2986d2ad11..08cd913cbd4e 100644
--- a/arch/x86/tools/insn_decoder_test.c
+++ b/arch/x86/tools/insn_decoder_test.c
@@ -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>
--
2.49.0