summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/xmon/xmon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 948d025f2939..0fa3aaeee105 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -857,8 +857,8 @@ static struct bpt *in_breakpoint_table(unsigned long nip, unsigned long *offp)
off = nip - (unsigned long)bpt_table;
if (off >= sizeof(bpt_table))
return NULL;
- *offp = off % BPT_SIZE;
- if (*offp != 0 && *offp != 4)
+ *offp = off & (BPT_SIZE - 1);
+ if (off & 3)
return NULL;
return bpts + (off / BPT_SIZE);
}