Skip to content

Commit 2271db2

Browse files
ozbenhmpe
authored andcommitted
powerpc: Use the TRAP macro whenever comparing a trap number
Trap numbers can have extra bits at the bottom that need to be filtered out. There are a few cases where we don't do that. It's possible that we got lucky but better safe than sorry. Signed-off-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 872e2ae commit 2271db2

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

arch/powerpc/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,7 @@ void show_regs(struct pt_regs * regs)
14091409
print_msr_bits(regs->msr);
14101410
pr_cont(" CR: %08lx XER: %08lx\n", regs->ccr, regs->xer);
14111411
trap = TRAP(regs);
1412-
if ((regs->trap != 0xc00) && cpu_has_feature(CPU_FTR_CFAR))
1412+
if ((TRAP(regs) != 0xc00) && cpu_has_feature(CPU_FTR_CFAR))
14131413
pr_cont("CFAR: "REG" ", regs->orig_gpr3);
14141414
if (trap == 0x200 || trap == 0x300 || trap == 0x600)
14151415
#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)

arch/powerpc/kernel/traps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ void facility_unavailable_exception(struct pt_regs *regs)
15641564
u8 status;
15651565
bool hv;
15661566

1567-
hv = (regs->trap == 0xf80);
1567+
hv = (TRAP(regs) == 0xf80);
15681568
if (hv)
15691569
value = mfspr(SPRN_HFSCR);
15701570
else

arch/powerpc/mm/fault.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)
571571

572572
/* kernel has accessed a bad area */
573573

574-
switch (regs->trap) {
574+
switch (TRAP(regs)) {
575575
case 0x300:
576576
case 0x380:
577577
printk(KERN_ALERT "Unable to handle kernel paging request for "

0 commit comments

Comments
 (0)