Skip to contentSkip to conversation

riscv: process: Use str_supported_unsupported() in compat_mode_detect()

PATCH Superseded Thorsten Blum 3 participants 6 messages Sep 24 – Nov 11 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: process: Use str_supported_unsupported() in compat_mode_detect()

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.

---
 arch/riscv/kernel/process.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/riscv/kernel/process.c +2 -1
index b2df7f72241a..967c27f2ae25 100644
@@ -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

maintainer
#1 lore raw
Quoted 5 lines · Thorsten Blum

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.

Thanks, queued for v7.4.

- Paul

#2 lore raw

Hi Paul, Thorsten,

Quoted 8 lines · Paul Walmsley
Quoted 5 lines · Thorsten Blum

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.

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

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
#3 lore raw
Quoted 22 lines · Geert Uytterhoeven

Hi Paul, Thorsten,

Quoted 8 lines · Paul Walmsley
Quoted 5 lines · Thorsten Blum

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.

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]

Quoted 7 lines
      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

maintainer
#4 lore raw
Quoted 31 lines · Thorsten Blum
Quoted 22 lines · Geert Uytterhoeven

Hi Paul, Thorsten,

Quoted 8 lines · Paul Walmsley
Quoted 5 lines · Thorsten Blum

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.

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]

Quoted 7 lines
      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.

Quoted 5 lines

Hi Geert,

It's also in linux-next:

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

I'm dropping this one until the dependency lands in mainline.

- Paul

#5 lore raw

Hi Paul,

Quoted 33 lines · Paul Walmsley
Quoted 31 lines · Thorsten Blum
Quoted 29 lines · Geert Uytterhoeven

Hi Paul, Thorsten,

Quoted 8 lines · Paul Walmsley
Quoted 5 lines · Thorsten Blum

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.

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.

Quoted 7 lines
Quoted 5 lines

Hi Geert,

It's also in linux-next:

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

I'm dropping this one until the dependency lands in mainline.

Do you want me to resend this patch now that the dependency [1] is in mainline, or can you re-apply this one?

Thanks,
Thorsten

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ccd5ff410feb2adcf3840d071cf796cc5c549520