All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/tools: Drop unlikely definition from insn_decoder_test
@ 2025-03-18 22:32 Nathan Chancellor
  2025-03-19 20:31 ` Ingo Molnar
  2025-03-28 22:04 ` [tip: x86/urgent] x86/tools: Drop duplicate unlikely() definition in insn_decoder_test.c tip-bot2 for Nathan Chancellor
  0 siblings, 2 replies; 5+ messages in thread
From: Nathan Chancellor @ 2025-03-18 22:32 UTC (permalink / raw)
  To: Shuah Khan, x86
  Cc: Rae Moar, Sergio González Collado, David Gow, linux-kernel,
	llvm, Nathan Chancellor

After commit c104c16073b7 ("Kunit to check the longest symbol length"),
there is a warning when building with clang because there is now a
definition of unlikely from compiler.h in tools/include/linux, which
conflicts with the one in the instruction decoder selftest.

  arch/x86/tools/insn_decoder_test.c:15:9: warning: 'unlikely' macro redefined [-Wmacro-redefined]
     15 | #define unlikely(cond) (cond)
        |         ^
  tools/include/linux/compiler.h:128:10: note: previous definition is here
    128 | # define unlikely(x)            __builtin_expect(!!(x), 0)
        |          ^
  1 warning generated.

Remove the second unlikely definition, as it is no longer necessary,
clearing up the warning.

Fixes: c104c16073b7 ("Kunit to check the longest symbol length")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 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>

---
base-commit: 2e0cf2b32f72b20b0db5cc665cd8465d0f257278
change-id: 20250318-x86-decoder-test-fix-unlikely-redef-1636897e4fe7

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


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

* Re: [PATCH] x86/tools: Drop unlikely definition from insn_decoder_test
  2025-03-18 22:32 [PATCH] x86/tools: Drop unlikely definition from insn_decoder_test Nathan Chancellor
@ 2025-03-19 20:31 ` Ingo Molnar
  2025-03-28 21:06   ` Shuah Khan
  2025-03-28 22:04 ` [tip: x86/urgent] x86/tools: Drop duplicate unlikely() definition in insn_decoder_test.c tip-bot2 for Nathan Chancellor
  1 sibling, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2025-03-19 20:31 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Shuah Khan, x86, Rae Moar, Sergio González Collado,
	David Gow, linux-kernel, llvm


* Nathan Chancellor <nathan@kernel.org> wrote:

> After commit c104c16073b7 ("Kunit to check the longest symbol length"),
> there is a warning when building with clang because there is now a
> definition of unlikely from compiler.h in tools/include/linux, which
> conflicts with the one in the instruction decoder selftest.
> 
>   arch/x86/tools/insn_decoder_test.c:15:9: warning: 'unlikely' macro redefined [-Wmacro-redefined]
>      15 | #define unlikely(cond) (cond)
>         |         ^
>   tools/include/linux/compiler.h:128:10: note: previous definition is here
>     128 | # define unlikely(x)            __builtin_expect(!!(x), 0)
>         |          ^
>   1 warning generated.
> 
> Remove the second unlikely definition, as it is no longer necessary,
> clearing up the warning.
> 
> Fixes: c104c16073b7 ("Kunit to check the longest symbol length")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>  arch/x86/tools/insn_decoder_test.c | 2 --
>  1 file changed, 2 deletions(-)

I suppose this should be merged into the Kunit tree? The c104c16073b7 
commit is in -next currently.

Anyway:

  Acked-by: Ingo Molnar <mingo@kernel.org>

Thanks,

	Ingo

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

* Re: [PATCH] x86/tools: Drop unlikely definition from insn_decoder_test
  2025-03-19 20:31 ` Ingo Molnar
@ 2025-03-28 21:06   ` Shuah Khan
  2025-03-28 21:56     ` Ingo Molnar
  0 siblings, 1 reply; 5+ messages in thread
From: Shuah Khan @ 2025-03-28 21:06 UTC (permalink / raw)
  To: Ingo Molnar, Nathan Chancellor, David Gow, Brendan Higgins
  Cc: x86, Rae Moar, Sergio González Collado, linux-kernel, llvm,
	KUnit Development, Shuah Khan

On 3/19/25 14:31, Ingo Molnar wrote:
> 
> * Nathan Chancellor <nathan@kernel.org> wrote:
> 
>> After commit c104c16073b7 ("Kunit to check the longest symbol length"),
>> there is a warning when building with clang because there is now a
>> definition of unlikely from compiler.h in tools/include/linux, which
>> conflicts with the one in the instruction decoder selftest.
>>
>>    arch/x86/tools/insn_decoder_test.c:15:9: warning: 'unlikely' macro redefined [-Wmacro-redefined]
>>       15 | #define unlikely(cond) (cond)
>>          |         ^
>>    tools/include/linux/compiler.h:128:10: note: previous definition is here
>>      128 | # define unlikely(x)            __builtin_expect(!!(x), 0)
>>          |          ^
>>    1 warning generated.
>>
>> Remove the second unlikely definition, as it is no longer necessary,
>> clearing up the warning.
>>
>> Fixes: c104c16073b7 ("Kunit to check the longest symbol length")
>> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
>> ---
>>   arch/x86/tools/insn_decoder_test.c | 2 --
>>   1 file changed, 2 deletions(-)
> 
> I suppose this should be merged into the Kunit tree? The c104c16073b7
> commit is in -next currently.
> 
> Anyway:
> 
>    Acked-by: Ingo Molnar <mingo@kernel.org>
> 

Thanks Ingo.

David/Brendan, Okay to apply this for the next rc?

thanks,
-- Shuah

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

* Re: [PATCH] x86/tools: Drop unlikely definition from insn_decoder_test
  2025-03-28 21:06   ` Shuah Khan
@ 2025-03-28 21:56     ` Ingo Molnar
  0 siblings, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2025-03-28 21:56 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Nathan Chancellor, David Gow, Brendan Higgins, x86, Rae Moar,
	Sergio González Collado, linux-kernel, llvm,
	KUnit Development


* Shuah Khan <skhan@linuxfoundation.org> wrote:

> On 3/19/25 14:31, Ingo Molnar wrote:
> > 
> > * Nathan Chancellor <nathan@kernel.org> wrote:
> > 
> > > After commit c104c16073b7 ("Kunit to check the longest symbol length"),
> > > there is a warning when building with clang because there is now a
> > > definition of unlikely from compiler.h in tools/include/linux, which
> > > conflicts with the one in the instruction decoder selftest.
> > > 
> > >    arch/x86/tools/insn_decoder_test.c:15:9: warning: 'unlikely' macro redefined [-Wmacro-redefined]
> > >       15 | #define unlikely(cond) (cond)
> > >          |         ^
> > >    tools/include/linux/compiler.h:128:10: note: previous definition is here
> > >      128 | # define unlikely(x)            __builtin_expect(!!(x), 0)
> > >          |          ^
> > >    1 warning generated.
> > > 
> > > Remove the second unlikely definition, as it is no longer necessary,
> > > clearing up the warning.
> > > 
> > > Fixes: c104c16073b7 ("Kunit to check the longest symbol length")
> > > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> > > ---
> > >   arch/x86/tools/insn_decoder_test.c | 2 --
> > >   1 file changed, 2 deletions(-)
> > 
> > I suppose this should be merged into the Kunit tree? The c104c16073b7
> > commit is in -next currently.
> > 
> > Anyway:
> > 
> >    Acked-by: Ingo Molnar <mingo@kernel.org>
> > 
> 
> Thanks Ingo.
> 
> David/Brendan, Okay to apply this for the next rc?

Since the original commit is now upstream, I've picked up this fix for 
x86/urgent and we'll send it to Linus in a day or two.

I've added your Ack:

  Acked-by: Shuah Khan <skhan@linuxfoundation.org>

if that's OK to you.

Thanks,

	Ingo

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

* [tip: x86/urgent] x86/tools: Drop duplicate unlikely() definition in insn_decoder_test.c
  2025-03-18 22:32 [PATCH] x86/tools: Drop unlikely definition from insn_decoder_test Nathan Chancellor
  2025-03-19 20:31 ` Ingo Molnar
@ 2025-03-28 22:04 ` tip-bot2 for Nathan Chancellor
  1 sibling, 0 replies; 5+ messages in thread
From: tip-bot2 for Nathan Chancellor @ 2025-03-28 22:04 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Nathan Chancellor, Ingo Molnar, Shuah Khan, x86, linux-kernel

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     f710202b2a45addea3dcdcd862770ecbaf6597ef
Gitweb:        https://git.kernel.org/tip/f710202b2a45addea3dcdcd862770ecbaf6597ef
Author:        Nathan Chancellor <nathan@kernel.org>
AuthorDate:    Tue, 18 Mar 2025 15:32:30 -07:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Fri, 28 Mar 2025 22:57:44 +01:00

x86/tools: Drop duplicate unlikely() definition in insn_decoder_test.c

After commit c104c16073b7 ("Kunit to check the longest symbol length"),
there is a warning when building with clang because there is now a
definition of unlikely from compiler.h in tools/include/linux, which
conflicts with the one in the instruction decoder selftest:

  arch/x86/tools/insn_decoder_test.c:15:9: warning: 'unlikely' macro redefined [-Wmacro-redefined]

Remove the second unlikely() definition, as it is no longer necessary,
clearing up the warning.

Fixes: c104c16073b7 ("Kunit to check the longest symbol length")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20250318-x86-decoder-test-fix-unlikely-redef-v1-1-74c84a7bf05b@kernel.org
---
 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 6c2986d..08cd913 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>

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

end of thread, other threads:[~2025-03-28 22:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-18 22:32 [PATCH] x86/tools: Drop unlikely definition from insn_decoder_test Nathan Chancellor
2025-03-19 20:31 ` Ingo Molnar
2025-03-28 21:06   ` Shuah Khan
2025-03-28 21:56     ` Ingo Molnar
2025-03-28 22:04 ` [tip: x86/urgent] x86/tools: Drop duplicate unlikely() definition in insn_decoder_test.c tip-bot2 for Nathan Chancellor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.