public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <monstr@monstr.eu>
To: Yang Li <yang.lee@linux.alibaba.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] microblaze: remove unneeded variable 'err'
Date: Wed, 10 Mar 2021 10:30:47 +0100	[thread overview]
Message-ID: <fe13a449-070a-dabc-4e45-7dcea0ce6bb9@monstr.eu> (raw)
In-Reply-To: <1615366218-7634-1-git-send-email-yang.lee@linux.alibaba.com>



On 3/10/21 9:50 AM, Yang Li wrote:
> Fix the following coccicheck warning:
> ./arch/microblaze/kernel/signal.c:60:14-17: Unneeded variable: "err".
> Return "0" on line 78
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>  arch/microblaze/kernel/signal.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c
> index fc61eb0..c4b7b30 100644
> --- a/arch/microblaze/kernel/signal.c
> +++ b/arch/microblaze/kernel/signal.c
> @@ -57,8 +57,6 @@ struct rt_sigframe {
>  static int restore_sigcontext(struct pt_regs *regs,
>  				struct sigcontext __user *sc, int *rval_p)
>  {
> -	unsigned int err = 0;
> -
>  #define COPY(x)		{err |= __get_user(regs->x, &sc->regs.x); }

This is wrong because as you use err is used here.

Thanks,
Michal


>  	COPY(r0);
>  	COPY(r1);
> @@ -75,7 +73,7 @@ static int restore_sigcontext(struct pt_regs *regs,
>  
>  	*rval_p = regs->r3;
>  
> -	return err;
> +	return 0;
>  }
>  
>  asmlinkage long sys_rt_sigreturn(struct pt_regs *regs)
> 

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs


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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10  8:50 [PATCH] microblaze: remove unneeded variable 'err' Yang Li
2021-03-10  9:30 ` Michal Simek [this message]
2021-03-10 13:00 ` kernel test robot

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=fe13a449-070a-dabc-4e45-7dcea0ce6bb9@monstr.eu \
    --to=monstr@monstr.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yang.lee@linux.alibaba.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