Skip to contentSkip to conversation

m68k: sun3: Use str_read_write() helper in mmu_emu_handle_fault()

PATCH In review Thorsten Blum 2 participants 3 messages Jan 17, 2025 – Feb 1, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 m68k: sun3: Use str_read_write() helper in mmu_emu_handle_fault()

Remove hard-coded strings by using the str_read_write() helper.

---
 arch/m68k/sun3/mmu_emu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/m68k/sun3/mmu_emu.c +2 -1
index 119bd32efcfb..7b15cc12637b 100644
@@ -17,6 +17,7 @@
 #include <linux/bitops.h>
 #include <linux/module.h>
 #include <linux/sched/mm.h>
+#include <linux/string_choices.h>
 
 #include <asm/setup.h>
 #include <asm/traps.h>
@@ -371,7 +372,7 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
 
 #ifdef DEBUG_MMU_EMU
 	pr_info("%s: vaddr=%lx type=%s crp=%p\n", __func__, vaddr,
-		read_flag ? "read" : "write", crp);
+		str_read_write(read_flag), crp);
 #endif
 
 	segment = (vaddr >> SUN3_PMEG_SIZE_BITS) & 0x7FF;
Signature · 1 line
2.48.0
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hi Thorsten,

Quoted 3 lines · Thorsten Blum

Remove hard-coded strings by using the str_read_write() helper.

Thanks for your patch!

i.e. will queue in the m68k tree for v6.15.

arch/m68k/sun3/mmu_emu.c int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault) · line 375

Quoted 8 lines
arch/m68k/sun3/mmu_emu.c +1 -1
@@ -371,7 +372,7 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
 
 #ifdef DEBUG_MMU_EMU
        pr_info("%s: vaddr=%lx type=%s crp=%p\n", __func__, vaddr,
-               read_flag ? "read" : "write", crp);
+               str_read_write(read_flag), crp);

You haven't really tested this with DEBUG_MMU_EMU enabled, have you? Fix sent.

arch/m68k/sun3/mmu_emu.c int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault) · line 378

Quoted 3 lines
arch/m68k/sun3/mmu_emu.c +0 -0
 #endif
 
        segment = (vaddr >> SUN3_PMEG_SIZE_BITS) & 0x7FF;

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

arch/m68k/sun3/mmu_emu.c int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault) · line 375

Quoted 8 lines
arch/m68k/sun3/mmu_emu.c +1 -1
@@ -371,7 +372,7 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
 
 #ifdef DEBUG_MMU_EMU
       pr_info("%s: vaddr=%lx type=%s crp=%p\n", __func__, vaddr,
-               read_flag ? "read" : "write", crp);
+               str_read_write(read_flag), crp);

You haven't really tested this with DEBUG_MMU_EMU enabled, have you? Fix sent.

Sorry, I missed this question.

I compile-tested it with DEBUG_MMU_EMU, but ignored the pr_info() error you fixed in [1].

Thanks,
Thorsten

[1] https://lore.kernel.org/linux-kernel/b1d12a1d24b4aea9f98d905383ba932b2dc382e6.1737387419.git.geert@linux-m68k.org/