Re: [PATCH -next] mips: remove unused variable 'prev_state'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 31, 2021 at 04:54:58PM +0800, Xu Jia wrote:
> GCC reports the following warning with W=1:
> 
> arch/mips/kernel/traps.c:1593:17: warning:
>  variable 'prev_state' set but not used [-Wunused-but-set-variable]
>  1593 |  enum ctx_state prev_state;
>       |                 ^~~~~~~~~~
> 
> This variable is not used in function , this commit
> remove it to fix the warning.
> 
> Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
> Signed-off-by: Xu Jia <xujia39@xxxxxxxxxx>
> ---
>  arch/mips/kernel/traps.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
> index 808b8b61ded1..d1f23ddf0c8c 100644
> --- a/arch/mips/kernel/traps.c
> +++ b/arch/mips/kernel/traps.c
> @@ -1590,10 +1590,8 @@ asmlinkage void do_watch(struct pt_regs *regs)
>  asmlinkage void do_mcheck(struct pt_regs *regs)
>  {
>  	int multi_match = regs->cp0_status & ST0_TS;
> -	enum ctx_state prev_state;
>  	mm_segment_t old_fs = get_fs();
>  
> -	prev_state = exception_enter();

Pretty sure the exception_enter() is still required...

>  	show_regs(regs);

regards,
dan carpenter




[Index of Archives]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux