Browse Source

arm64: debug: remove redundant spsr manipulation

There is no need to explicitly clear the SS bit immediately before
setting it unconditionally.

Reported-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Will Deacon 9 years ago
parent
commit
6b68e14e71
1 changed files with 2 additions and 11 deletions
  1. 2 11
      arch/arm64/kernel/debug-monitors.c

+ 2 - 11
arch/arm64/kernel/debug-monitors.c

@@ -165,21 +165,12 @@ postcore_initcall(debug_monitors_init);
  */
  */
 static void set_regs_spsr_ss(struct pt_regs *regs)
 static void set_regs_spsr_ss(struct pt_regs *regs)
 {
 {
-	unsigned long spsr;
-
-	spsr = regs->pstate;
-	spsr &= ~DBG_SPSR_SS;
-	spsr |= DBG_SPSR_SS;
-	regs->pstate = spsr;
+	regs->pstate |= DBG_SPSR_SS;
 }
 }
 
 
 static void clear_regs_spsr_ss(struct pt_regs *regs)
 static void clear_regs_spsr_ss(struct pt_regs *regs)
 {
 {
-	unsigned long spsr;
-
-	spsr = regs->pstate;
-	spsr &= ~DBG_SPSR_SS;
-	regs->pstate = spsr;
+	regs->pstate &= ~DBG_SPSR_SS;
 }
 }
 
 
 /* EL1 Single Step Handler hooks */
 /* EL1 Single Step Handler hooks */