summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/ptrace
diff options
context:
space:
mode:
authorRavi Bangoria <ravi.bangoria@linux.ibm.com>2020-05-14 16:47:37 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2020-05-19 00:11:05 +1000
commite68ef121c1f4c38edf87a3354661ceb99d522729 (patch)
tree19a1a3a86436cb72a841ad52e7e43ebdcb196495 /arch/powerpc/kernel/ptrace
parentc9e82aeb197df2d93b1b4234bc0c80943fa594e8 (diff)
downloadlinux-e68ef121c1f4c38edf87a3354661ceb99d522729.tar.bz2
powerpc/watchpoint: Use builtin ALIGN*() macros
Currently we calculate hw aligned start and end addresses manually. Replace them with builtin ALIGN_DOWN() and ALIGN() macros. So far end_addr was inclusive but this patch makes it exclusive (by avoiding -1) for better readability. Suggested-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Reviewed-by: Michael Neuling <mikey@neuling.org> Link: https://lore.kernel.org/r/20200514111741.97993-13-ravi.bangoria@linux.ibm.com
Diffstat (limited to 'arch/powerpc/kernel/ptrace')
-rw-r--r--arch/powerpc/kernel/ptrace/ptrace-noadv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/ptrace/ptrace-noadv.c b/arch/powerpc/kernel/ptrace/ptrace-noadv.c
index 08cb8c1b504c..697c7e4b5877 100644
--- a/arch/powerpc/kernel/ptrace/ptrace-noadv.c
+++ b/arch/powerpc/kernel/ptrace/ptrace-noadv.c
@@ -216,7 +216,7 @@ long ppc_set_hwdebug(struct task_struct *child, struct ppc_hw_breakpoint *bp_inf
if ((unsigned long)bp_info->addr >= TASK_SIZE)
return -EIO;
- brk.address = bp_info->addr & ~HW_BREAKPOINT_ALIGN;
+ brk.address = ALIGN_DOWN(bp_info->addr, HW_BREAKPOINT_SIZE);
brk.type = HW_BRK_TYPE_TRANSLATE;
brk.len = DABR_MAX_LEN;
if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_READ)