diff mbox series

[03/10] arm64: debug: Remove unused return value from do_debug_exception()

Message ID 20190301132809.24653-4-will.deacon@arm.com (mailing list archive)
State New, archived
Headers show
Series Rework debug exception handling code | expand

Commit Message

Will Deacon March 1, 2019, 1:28 p.m. UTC
do_debug_exception() goes out of its way to return a value that isn't
ever used, so just make the thing void.

Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 arch/arm64/mm/fault.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

Comments

Mark Rutland March 1, 2019, 1:48 p.m. UTC | #1
On Fri, Mar 01, 2019 at 01:28:02PM +0000, Will Deacon wrote:
> do_debug_exception() goes out of its way to return a value that isn't
> ever used, so just make the thing void.
> 
> Signed-off-by: Will Deacon <will.deacon@arm.com>

Reviewed-by: Mark Rutland <mark.rutland@arm.com>

Mark.

> ---
>  arch/arm64/mm/fault.c | 14 ++++----------
>  1 file changed, 4 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
> index ef46925096f0..f684f92d517c 100644
> --- a/arch/arm64/mm/fault.c
> +++ b/arch/arm64/mm/fault.c
> @@ -824,13 +824,12 @@ void __init hook_debug_fault_code(int nr,
>  	debug_fault_info[nr].name	= name;
>  }
>  
> -asmlinkage int __exception do_debug_exception(unsigned long addr_if_watchpoint,
> -					      unsigned int esr,
> -					      struct pt_regs *regs)
> +asmlinkage void __exception do_debug_exception(unsigned long addr_if_watchpoint,
> +					       unsigned int esr,
> +					       struct pt_regs *regs)
>  {
>  	const struct fault_info *inf = esr_to_debug_fault_info(esr);
>  	unsigned long pc = instruction_pointer(regs);
> -	int rv;
>  
>  	/*
>  	 * Tell lockdep we disabled irqs in entry.S. Do nothing if they were
> @@ -842,17 +841,12 @@ asmlinkage int __exception do_debug_exception(unsigned long addr_if_watchpoint,
>  	if (user_mode(regs) && !is_ttbr0_addr(pc))
>  		arm64_apply_bp_hardening();
>  
> -	if (!inf->fn(addr_if_watchpoint, esr, regs)) {
> -		rv = 1;
> -	} else {
> +	if (inf->fn(addr_if_watchpoint, esr, regs)) {
>  		arm64_notify_die(inf->name, regs,
>  				 inf->sig, inf->code, (void __user *)pc, esr);
> -		rv = 0;
>  	}
>  
>  	if (interrupts_enabled(regs))
>  		trace_hardirqs_on();
> -
> -	return rv;
>  }
>  NOKPROBE_SYMBOL(do_debug_exception);
> -- 
> 2.11.0
>
diff mbox series

Patch

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index ef46925096f0..f684f92d517c 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -824,13 +824,12 @@  void __init hook_debug_fault_code(int nr,
 	debug_fault_info[nr].name	= name;
 }
 
-asmlinkage int __exception do_debug_exception(unsigned long addr_if_watchpoint,
-					      unsigned int esr,
-					      struct pt_regs *regs)
+asmlinkage void __exception do_debug_exception(unsigned long addr_if_watchpoint,
+					       unsigned int esr,
+					       struct pt_regs *regs)
 {
 	const struct fault_info *inf = esr_to_debug_fault_info(esr);
 	unsigned long pc = instruction_pointer(regs);
-	int rv;
 
 	/*
 	 * Tell lockdep we disabled irqs in entry.S. Do nothing if they were
@@ -842,17 +841,12 @@  asmlinkage int __exception do_debug_exception(unsigned long addr_if_watchpoint,
 	if (user_mode(regs) && !is_ttbr0_addr(pc))
 		arm64_apply_bp_hardening();
 
-	if (!inf->fn(addr_if_watchpoint, esr, regs)) {
-		rv = 1;
-	} else {
+	if (inf->fn(addr_if_watchpoint, esr, regs)) {
 		arm64_notify_die(inf->name, regs,
 				 inf->sig, inf->code, (void __user *)pc, esr);
-		rv = 0;
 	}
 
 	if (interrupts_enabled(regs))
 		trace_hardirqs_on();
-
-	return rv;
 }
 NOKPROBE_SYMBOL(do_debug_exception);