public inbox for linux-mips@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Xu Jia <xujia39@huawei.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Huacai Chen <chenhuacai@kernel.org>, WANG Xuerui <git@xen0n.name>,
	Dmitry Safonov <0x7f454c46@gmail.com>,
	Liangliang Huang <huanglllzu@gmail.com>,
	Xingxing Su <suxingxing@loongson.cn>,
	Huang Pei <huangpei@loongson.cn>,
	linux-mips@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next] mips: remove unused variable 'prev_state'
Date: Wed, 31 Mar 2021 12:22:54 +0300	[thread overview]
Message-ID: <20210331092254.GJ2065@kadam> (raw)
In-Reply-To: <1617180898-36838-1-git-send-email-xujia39@huawei.com>

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@huawei.com>
> Signed-off-by: Xu Jia <xujia39@huawei.com>
> ---
>  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


      parent reply	other threads:[~2021-03-31  9:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-31  8:54 [PATCH -next] mips: remove unused variable 'prev_state' Xu Jia
2021-03-31  9:02 ` Colin Ian King
2021-03-31  9:22 ` Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210331092254.GJ2065@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=0x7f454c46@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=chenhuacai@kernel.org \
    --cc=git@xen0n.name \
    --cc=huanglllzu@gmail.com \
    --cc=huangpei@loongson.cn \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=suxingxing@loongson.cn \
    --cc=tsbogend@alpha.franken.de \
    --cc=xujia39@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox