mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Remove "#define unlikely(cond) (cond)"
@ 2025-04-01 21:14 H.J. Lu
  2025-04-01 21:23 ` Mario Limonciello
  0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2025-04-01 21:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: sergio.collado, mario.limonciello

commit c104c16073b7fdb3e4eae18f66f4009f6b073d6f
Author: Sergio González Collado <sergio.collado@gmail.com>
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@gmail.com>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Remove "#define unlikely(cond) (cond)"
  2025-04-01 21:14 [PATCH] Remove "#define unlikely(cond) (cond)" H.J. Lu
@ 2025-04-01 21:23 ` Mario Limonciello
  0 siblings, 0 replies; 2+ messages in thread
From: Mario Limonciello @ 2025-04-01 21:23 UTC (permalink / raw)
  To: H.J. Lu, linux-kernel; +Cc: sergio.collado

On 4/1/2025 4:14 PM, H.J. Lu wrote:
> commit c104c16073b7fdb3e4eae18f66f4009f6b073d6f
> Author: Sergio González Collado <sergio.collado@gmail.com>
> 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@gmail.com>
> ---
>   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>

Sorry I didn't notice when I suggested to submit, but this same patch 
was submitted a week ago.

https://lkml.org/lkml/2025/3/18/1606



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-01 21:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-01 21:14 [PATCH] Remove "#define unlikely(cond) (cond)" H.J. Lu
2025-04-01 21:23 ` Mario Limonciello

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®