Skip to content

Commit fc10edd

Browse files
tobluxgeertu
authored andcommitted
m68k: kernel: Use str_read_write() helper function
Remove hard-coded strings by using the str_read_write() helper function and remove some unnecessary negations. Compile-tested only. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://lore.kernel.org/20241020205758.332095-1-thorsten.blum@linux.dev Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
1 parent 6070970 commit fc10edd

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

arch/m68k/kernel/traps.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ static inline void bus_error030 (struct frame *fp)
383383
fp->ptregs.format == 0xa ? fp->ptregs.pc + 4 : fp->un.fmtb.baddr);
384384
if (ssw & DF)
385385
pr_debug("Data %s fault at %#010lx in %s (pc=%#lx)\n",
386-
ssw & RW ? "read" : "write",
386+
str_read_write(ssw & RW),
387387
fp->un.fmtb.daddr,
388388
space_names[ssw & DFC], fp->ptregs.pc);
389389

@@ -419,7 +419,7 @@ static inline void bus_error030 (struct frame *fp)
419419
}
420420

421421
pr_err("Data %s fault at %#010lx in %s (pc=%#lx)\n",
422-
ssw & RW ? "read" : "write",
422+
str_read_write(ssw & RW),
423423
fp->un.fmtb.daddr,
424424
space_names[ssw & DFC], fp->ptregs.pc);
425425
}
@@ -455,7 +455,7 @@ static inline void bus_error030 (struct frame *fp)
455455
pr_debug("*** unexpected busfault type=%#04x\n",
456456
buserr_type);
457457
pr_debug("invalid %s access at %#lx from pc %#lx\n",
458-
!(ssw & RW) ? "write" : "read", addr,
458+
str_read_write(ssw & RW), addr,
459459
fp->ptregs.pc);
460460
die_if_kernel ("Oops", &fp->ptregs, buserr_type);
461461
force_sig (SIGBUS);
@@ -514,7 +514,7 @@ static inline void bus_error030 (struct frame *fp)
514514
fp->ptregs.format == 0xa ? fp->ptregs.pc + 4 : fp->un.fmtb.baddr);
515515
if (ssw & DF)
516516
pr_debug("Data %s fault at %#010lx in %s (pc=%#lx)\n",
517-
ssw & RW ? "read" : "write",
517+
str_read_write(ssw & RW),
518518
fp->un.fmtb.daddr,
519519
space_names[ssw & DFC], fp->ptregs.pc);
520520

@@ -548,7 +548,7 @@ static inline void bus_error030 (struct frame *fp)
548548
/* We might have an exception table for this PC */
549549
if (ssw & 4 && !search_exception_tables(fp->ptregs.pc)) {
550550
pr_err("Data %s fault at %#010lx in %s (pc=%#lx)\n",
551-
ssw & RW ? "read" : "write",
551+
str_read_write(ssw & RW),
552552
fp->un.fmtb.daddr,
553553
space_names[ssw & DFC], fp->ptregs.pc);
554554
goto buserr;
@@ -564,7 +564,7 @@ static inline void bus_error030 (struct frame *fp)
564564
mmusr);
565565
} else if (mmusr & (MMU_B|MMU_L|MMU_S)) {
566566
pr_err("invalid %s access at %#lx from pc %#lx\n",
567-
!(ssw & RW) ? "write" : "read", addr,
567+
str_read_write(ssw & RW), addr,
568568
fp->ptregs.pc);
569569
die_if_kernel("Oops",&fp->ptregs,mmusr);
570570
force_sig(SIGSEGV);
@@ -575,7 +575,7 @@ static inline void bus_error030 (struct frame *fp)
575575
#endif
576576

577577
pr_err("weird %s access at %#lx from pc %#lx (ssw is %#x)\n",
578-
!(ssw & RW) ? "write" : "read", addr,
578+
str_read_write(ssw & RW), addr,
579579
fp->ptregs.pc, ssw);
580580
asm volatile ("ptestr #1,%1@,#0\n\t"
581581
"pmove %%psr,%0"
@@ -991,7 +991,7 @@ static void bad_super_trap(struct frame *fp)
991991
fp->ptregs.pc + 4 : fp->un.fmtb.baddr);
992992
if (ssw & DF)
993993
pr_err("Data %s fault at %#010lx in %s (pc=%#lx)\n",
994-
ssw & RW ? "read" : "write",
994+
str_read_write(ssw & RW),
995995
fp->un.fmtb.daddr, space_names[ssw & DFC],
996996
fp->ptregs.pc);
997997
}

0 commit comments

Comments
 (0)