[PATCH 2/4] arm64: debug: remove redundant spsr manipulation

Mark Rutland mark.rutland at arm.com
Tue Jul 19 07:36:50 PDT 2016


On Tue, Jul 19, 2016 at 03:07:38PM +0100, Will Deacon wrote:
> There is no need to explicitly clear the SS bit immediately before
> setting it unconditionally.
> 
> Reported-by: Catalin Marinas <catalin.marinas at arm.com>
> Signed-off-by: Will Deacon <will.deacon at arm.com>

Acked-by: Mark Rutland <mark.rutland at arm.com>

Mark.

> ---
>  arch/arm64/kernel/debug-monitors.c | 13 ++-----------
>  1 file changed, 2 insertions(+), 11 deletions(-)
> 
> diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
> index 7a907e401c98..91fff48d0f57 100644
> --- a/arch/arm64/kernel/debug-monitors.c
> +++ b/arch/arm64/kernel/debug-monitors.c
> @@ -170,22 +170,13 @@ 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;
>  }
>  NOKPROBE_SYMBOL(set_regs_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;
>  }
>  NOKPROBE_SYMBOL(clear_regs_spsr_ss);
>  
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 



More information about the linux-arm-kernel mailing list