arm64: Add brackets around user_stack_pointer()
authorCatalin Marinas <catalin.marinas@arm.com>
Fri, 29 Aug 2014 15:08:02 +0000 (16:08 +0100)
committerGreg Hackmann <ghackmann@google.com>
Fri, 29 Aug 2014 23:49:10 +0000 (16:49 -0700)
Commit 5f888a1d33 (ARM64: perf: support dwarf unwinding in compat mode)
changes user_stack_pointer() to return the compat SP for 32-bit tasks
but without brackets around the whole definition, with possible issues
on the call sites (noticed with a subsequent fix for KSTK_ESP).

Fixes: 5f888a1d33c4 (ARM64: perf: support dwarf unwinding in compat mode)
Reported-by: Sudeep Holla <sudeep.holla@arm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/ptrace.h

index c2a199727e4fa1f2d92f541636a7461212b0e4e9..7304fa2fd9fafe0fceeeb7c36fec196cea3651dd 100644 (file)
@@ -131,7 +131,7 @@ struct pt_regs {
        (!((regs)->pstate & PSR_F_BIT))
 
 #define user_stack_pointer(regs) \
-       (!compat_user_mode(regs)) ? ((regs)->sp) : ((regs)->compat_sp)
+       (!compat_user_mode(regs) ? (regs)->sp : (regs)->compat_sp)
 
 /*
  * Are the current registers suitable for user mode? (used to maintain