Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Thorsten Blum and committed by
Geert Uytterhoeven
fc10edd9 6070970d

+8 -8
+8 -8
arch/m68k/kernel/traps.c
··· 383 383 fp->ptregs.format == 0xa ? fp->ptregs.pc + 4 : fp->un.fmtb.baddr); 384 384 if (ssw & DF) 385 385 pr_debug("Data %s fault at %#010lx in %s (pc=%#lx)\n", 386 - ssw & RW ? "read" : "write", 386 + str_read_write(ssw & RW), 387 387 fp->un.fmtb.daddr, 388 388 space_names[ssw & DFC], fp->ptregs.pc); 389 389 ··· 419 419 } 420 420 421 421 pr_err("Data %s fault at %#010lx in %s (pc=%#lx)\n", 422 - ssw & RW ? "read" : "write", 422 + str_read_write(ssw & RW), 423 423 fp->un.fmtb.daddr, 424 424 space_names[ssw & DFC], fp->ptregs.pc); 425 425 } ··· 455 455 pr_debug("*** unexpected busfault type=%#04x\n", 456 456 buserr_type); 457 457 pr_debug("invalid %s access at %#lx from pc %#lx\n", 458 - !(ssw & RW) ? "write" : "read", addr, 458 + str_read_write(ssw & RW), addr, 459 459 fp->ptregs.pc); 460 460 die_if_kernel ("Oops", &fp->ptregs, buserr_type); 461 461 force_sig (SIGBUS); ··· 514 514 fp->ptregs.format == 0xa ? fp->ptregs.pc + 4 : fp->un.fmtb.baddr); 515 515 if (ssw & DF) 516 516 pr_debug("Data %s fault at %#010lx in %s (pc=%#lx)\n", 517 - ssw & RW ? "read" : "write", 517 + str_read_write(ssw & RW), 518 518 fp->un.fmtb.daddr, 519 519 space_names[ssw & DFC], fp->ptregs.pc); 520 520 ··· 548 548 /* We might have an exception table for this PC */ 549 549 if (ssw & 4 && !search_exception_tables(fp->ptregs.pc)) { 550 550 pr_err("Data %s fault at %#010lx in %s (pc=%#lx)\n", 551 - ssw & RW ? "read" : "write", 551 + str_read_write(ssw & RW), 552 552 fp->un.fmtb.daddr, 553 553 space_names[ssw & DFC], fp->ptregs.pc); 554 554 goto buserr; ··· 564 564 mmusr); 565 565 } else if (mmusr & (MMU_B|MMU_L|MMU_S)) { 566 566 pr_err("invalid %s access at %#lx from pc %#lx\n", 567 - !(ssw & RW) ? "write" : "read", addr, 567 + str_read_write(ssw & RW), addr, 568 568 fp->ptregs.pc); 569 569 die_if_kernel("Oops",&fp->ptregs,mmusr); 570 570 force_sig(SIGSEGV); ··· 575 575 #endif 576 576 577 577 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, 579 579 fp->ptregs.pc, ssw); 580 580 asm volatile ("ptestr #1,%1@,#0\n\t" 581 581 "pmove %%psr,%0" ··· 991 991 fp->ptregs.pc + 4 : fp->un.fmtb.baddr); 992 992 if (ssw & DF) 993 993 pr_err("Data %s fault at %#010lx in %s (pc=%#lx)\n", 994 - ssw & RW ? "read" : "write", 994 + str_read_write(ssw & RW), 995 995 fp->un.fmtb.daddr, space_names[ssw & DFC], 996 996 fp->ptregs.pc); 997 997 }