arm64: debug: remove redundant spsr manipulation
authorWill Deacon <will.deacon@arm.com>
Tue, 19 Jul 2016 14:07:38 +0000 (15:07 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 19 Jul 2016 15:58:56 +0000 (16:58 +0100)
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>
arch/arm64/kernel/debug-monitors.c

index 0800d23e2fdd693b092bb2226e677fa8ddbc1aa1..f17134d39e6bcbbd6210d67be235e9672d90a915 100644 (file)
@@ -165,21 +165,12 @@ postcore_initcall(debug_monitors_init);
  */
 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)
 {
-       unsigned long spsr;
-
-       spsr = regs->pstate;
-       spsr &= ~DBG_SPSR_SS;
-       regs->pstate = spsr;
+       regs->pstate &= ~DBG_SPSR_SS;
 }
 
 /* EL1 Single Step Handler hooks */