mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] riscv: process: Use str_supported_unsupported() in compat_mode_detect()
@ 2026-09-24 21:32 Thorsten Blum
  2026-09-25 23:48 ` Paul Walmsley
  0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Blum @ 2026-09-24 21:32 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Deepak Gupta, Zong Li, Samuel Holland, Zishun Yi
  Cc: Thorsten Blum, linux-riscv, linux-kernel

Replace hard-coded strings with the str_supported_unsupported() helper.
This unifies the output and helps the linker with deduplication, which
can result in a smaller binary.

Signed-off-by: Thorsten Blum <blum@kernel.org>
---
 arch/riscv/kernel/process.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c
index b2df7f72241a..967c27f2ae25 100644
--- a/arch/riscv/kernel/process.c
+++ b/arch/riscv/kernel/process.c
@@ -13,6 +13,7 @@
 #include <linux/sched.h>
 #include <linux/sched/debug.h>
 #include <linux/sched/task_stack.h>
+#include <linux/string_choices.h>
 #include <linux/tick.h>
 #include <linux/ptrace.h>
 #include <linux/uaccess.h>
@@ -134,7 +135,7 @@ static int __init compat_mode_detect(void)
 	csr_write(CSR_STATUS, tmp);
 
 	pr_info("riscv: ELF compat mode %s",
-			compat_mode_supported ? "supported" : "unsupported");
+		str_supported_unsupported(compat_mode_supported));
 
 	return 0;
 }

base-commit: 5383cf280ef4f00b15f1d9e2a2886d0d02c0118b

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

* Re: [PATCH] riscv: process: Use str_supported_unsupported() in compat_mode_detect()
  2026-09-24 21:32 [PATCH] riscv: process: Use str_supported_unsupported() in compat_mode_detect() Thorsten Blum
@ 2026-09-25 23:48 ` Paul Walmsley
  2026-09-29  9:11   ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Walmsley @ 2026-09-25 23:48 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Deepak Gupta, Zong Li, Samuel Holland, Zishun Yi, linux-riscv,
	linux-kernel

On Thu, 24 Sep 2026, Thorsten Blum wrote:

> Replace hard-coded strings with the str_supported_unsupported() helper.
> This unifies the output and helps the linker with deduplication, which
> can result in a smaller binary.
> 
> Signed-off-by: Thorsten Blum <blum@kernel.org>

Thanks, queued for v7.4.

- Paul

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

* Re: [PATCH] riscv: process: Use str_supported_unsupported() in compat_mode_detect()
  2026-09-25 23:48 ` Paul Walmsley
@ 2026-09-29  9:11   ` Geert Uytterhoeven
  2026-09-29  9:41     ` Thorsten Blum
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2026-09-29  9:11 UTC (permalink / raw)
  To: Paul Walmsley, Thorsten Blum
  Cc: Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Deepak Gupta,
	Zong Li, Samuel Holland, Zishun Yi, linux-riscv, linux-kernel

Hi Paul, Thorsten,

On Sat, 26 Sept 2026 at 01:48, Paul Walmsley <pjw@kernel.org> wrote:
> On Thu, 24 Sep 2026, Thorsten Blum wrote:
> > Replace hard-coded strings with the str_supported_unsupported() helper.
> > This unifies the output and helps the linker with deduplication, which
> > can result in a smaller binary.
> >
> > Signed-off-by: Thorsten Blum <blum@kernel.org>
>
> Thanks, queued for v7.4.

Thanks for your patch, which is now commit a06776565b9e7351 ("riscv:
process: Use str_supported_unsupported() in compat_mode_detect()")
in riscv/for-next.

This fails to build:

    arch/riscv/kernel/process.c: In function ‘compat_mode_detect’:
    arch/riscv/kernel/process.c:138:17: error: implicit declaration of
function ‘str_supported_unsupported’
[-Werror=implicit-function-declaration]
      138 |                 str_supported_unsupported(compat_mode_supported));
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~

as it has a hard dependency on commit 5383cf280ef4f00b
("lib/string_choices: Add str_supported_unsupported()
helper"), which is only present in the for-next branch of
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH] riscv: process: Use str_supported_unsupported() in compat_mode_detect()
  2026-09-29  9:11   ` Geert Uytterhoeven
@ 2026-09-29  9:41     ` Thorsten Blum
  0 siblings, 0 replies; 4+ messages in thread
From: Thorsten Blum @ 2026-09-29  9:41 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	Deepak Gupta, Zong Li, Samuel Holland, Zishun Yi, linux-riscv,
	linux-kernel

On Tue, Sep 29, 2026 at 11:11:55AM +0200, Geert Uytterhoeven wrote:
> Hi Paul, Thorsten,
> 
> On Sat, 26 Sept 2026 at 01:48, Paul Walmsley <pjw@kernel.org> wrote:
> > On Thu, 24 Sep 2026, Thorsten Blum wrote:
> > > Replace hard-coded strings with the str_supported_unsupported() helper.
> > > This unifies the output and helps the linker with deduplication, which
> > > can result in a smaller binary.
> > >
> > > Signed-off-by: Thorsten Blum <blum@kernel.org>
> >
> > Thanks, queued for v7.4.
> 
> Thanks for your patch, which is now commit a06776565b9e7351 ("riscv:
> process: Use str_supported_unsupported() in compat_mode_detect()")
> in riscv/for-next.
> 
> This fails to build:
> 
>     arch/riscv/kernel/process.c: In function ‘compat_mode_detect’:
>     arch/riscv/kernel/process.c:138:17: error: implicit declaration of
> function ‘str_supported_unsupported’
> [-Werror=implicit-function-declaration]
>       138 |                 str_supported_unsupported(compat_mode_supported));
>           |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
> 
> as it has a hard dependency on commit 5383cf280ef4f00b
> ("lib/string_choices: Add str_supported_unsupported()
> helper"), which is only present in the for-next branch of
> https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git.

Hi Geert,

It's also in linux-next:

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=5383cf280ef4f00b15f1d9e2a2886d0d02c0118b

Thanks,
Thorsten

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

end of thread, other threads:[~2026-09-29  9:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-24 21:32 [PATCH] riscv: process: Use str_supported_unsupported() in compat_mode_detect() Thorsten Blum
2026-09-25 23:48 ` Paul Walmsley
2026-09-29  9:11   ` Geert Uytterhoeven
2026-09-29  9:41     ` Thorsten Blum

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®