lkml.org 
[lkml]   [2021]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] microblaze: remove unneeded variable 'err'
From
Date


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

\
 
 \ /
  Last update: 2021-03-10 10:32    [W:0.064 / U:0.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site