All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] microblaze: remove unneeded variable 'err'
@ 2021-03-10  8:50 Yang Li
  2021-03-10  9:30 ` Michal Simek
  2021-03-10 13:00   ` kernel test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Yang Li @ 2021-03-10  8:50 UTC (permalink / raw
  To: monstr; +Cc: linux-kernel, Yang Li

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); }
 	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)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] microblaze: remove unneeded variable 'err'
  2021-03-10  8:50 [PATCH] microblaze: remove unneeded variable 'err' Yang Li
@ 2021-03-10  9:30 ` Michal Simek
  2021-03-10 13:00   ` kernel test robot
  1 sibling, 0 replies; 4+ messages in thread
From: Michal Simek @ 2021-03-10  9:30 UTC (permalink / raw
  To: Yang Li; +Cc: linux-kernel



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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] microblaze: remove unneeded variable 'err'
  2021-03-10  8:50 [PATCH] microblaze: remove unneeded variable 'err' Yang Li
@ 2021-03-10 13:00   ` kernel test robot
  2021-03-10 13:00   ` kernel test robot
  1 sibling, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-03-10 13:00 UTC (permalink / raw
  To: Yang Li, monstr; +Cc: kbuild-all, linux-kernel, Yang Li

[-- Attachment #1: Type: text/plain, Size: 4025 bytes --]

Hi Yang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v5.12-rc2 next-20210310]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yang-Li/microblaze-remove-unneeded-variable-err/20210310-165230
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 144c79ef33536b4ecb4951e07dbc1f2b7fa99d32
config: microblaze-randconfig-r006-20210309 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/3e5cd1e0be818f4bfaafd1c6fed6775d27816f40
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yang-Li/microblaze-remove-unneeded-variable-err/20210310-165230
        git checkout 3e5cd1e0be818f4bfaafd1c6fed6775d27816f40
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   arch/microblaze/kernel/signal.c: In function 'restore_sigcontext':
>> arch/microblaze/kernel/signal.c:60:19: error: 'err' undeclared (first use in this function)
      60 | #define COPY(x)  {err |= __get_user(regs->x, &sc->regs.x); }
         |                   ^~~
   arch/microblaze/kernel/signal.c:61:2: note: in expansion of macro 'COPY'
      61 |  COPY(r0);
         |  ^~~~
   arch/microblaze/kernel/signal.c:60:19: note: each undeclared identifier is reported only once for each function it appears in
      60 | #define COPY(x)  {err |= __get_user(regs->x, &sc->regs.x); }
         |                   ^~~
   arch/microblaze/kernel/signal.c:61:2: note: in expansion of macro 'COPY'
      61 |  COPY(r0);
         |  ^~~~


vim +/err +60 arch/microblaze/kernel/signal.c

2148daa9c45ff4 Michal Simek  2009-03-27  56  
353b431bafc42e Arnd Bergmann 2009-05-01  57  static int restore_sigcontext(struct pt_regs *regs,
353b431bafc42e Arnd Bergmann 2009-05-01  58  				struct sigcontext __user *sc, int *rval_p)
2148daa9c45ff4 Michal Simek  2009-03-27  59  {
2148daa9c45ff4 Michal Simek  2009-03-27 @60  #define COPY(x)		{err |= __get_user(regs->x, &sc->regs.x); }
2148daa9c45ff4 Michal Simek  2009-03-27  61  	COPY(r0);
2148daa9c45ff4 Michal Simek  2009-03-27  62  	COPY(r1);
2148daa9c45ff4 Michal Simek  2009-03-27  63  	COPY(r2);	COPY(r3);	COPY(r4);	COPY(r5);
2148daa9c45ff4 Michal Simek  2009-03-27  64  	COPY(r6);	COPY(r7);	COPY(r8);	COPY(r9);
2148daa9c45ff4 Michal Simek  2009-03-27  65  	COPY(r10);	COPY(r11);	COPY(r12);	COPY(r13);
2148daa9c45ff4 Michal Simek  2009-03-27  66  	COPY(r14);	COPY(r15);	COPY(r16);	COPY(r17);
2148daa9c45ff4 Michal Simek  2009-03-27  67  	COPY(r18);	COPY(r19);	COPY(r20);	COPY(r21);
2148daa9c45ff4 Michal Simek  2009-03-27  68  	COPY(r22);	COPY(r23);	COPY(r24);	COPY(r25);
2148daa9c45ff4 Michal Simek  2009-03-27  69  	COPY(r26);	COPY(r27);	COPY(r28);	COPY(r29);
2148daa9c45ff4 Michal Simek  2009-03-27  70  	COPY(r30);	COPY(r31);
2148daa9c45ff4 Michal Simek  2009-03-27  71  	COPY(pc);	COPY(ear);	COPY(esr);	COPY(fsr);
2148daa9c45ff4 Michal Simek  2009-03-27  72  #undef COPY
2148daa9c45ff4 Michal Simek  2009-03-27  73  
2148daa9c45ff4 Michal Simek  2009-03-27  74  	*rval_p = regs->r3;
2148daa9c45ff4 Michal Simek  2009-03-27  75  
3e5cd1e0be818f Yang Li       2021-03-10  76  	return 0;
2148daa9c45ff4 Michal Simek  2009-03-27  77  }
2148daa9c45ff4 Michal Simek  2009-03-27  78  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26106 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] microblaze: remove unneeded variable 'err'
@ 2021-03-10 13:00   ` kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-03-10 13:00 UTC (permalink / raw
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4100 bytes --]

Hi Yang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v5.12-rc2 next-20210310]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Yang-Li/microblaze-remove-unneeded-variable-err/20210310-165230
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 144c79ef33536b4ecb4951e07dbc1f2b7fa99d32
config: microblaze-randconfig-r006-20210309 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/3e5cd1e0be818f4bfaafd1c6fed6775d27816f40
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Yang-Li/microblaze-remove-unneeded-variable-err/20210310-165230
        git checkout 3e5cd1e0be818f4bfaafd1c6fed6775d27816f40
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   arch/microblaze/kernel/signal.c: In function 'restore_sigcontext':
>> arch/microblaze/kernel/signal.c:60:19: error: 'err' undeclared (first use in this function)
      60 | #define COPY(x)  {err |= __get_user(regs->x, &sc->regs.x); }
         |                   ^~~
   arch/microblaze/kernel/signal.c:61:2: note: in expansion of macro 'COPY'
      61 |  COPY(r0);
         |  ^~~~
   arch/microblaze/kernel/signal.c:60:19: note: each undeclared identifier is reported only once for each function it appears in
      60 | #define COPY(x)  {err |= __get_user(regs->x, &sc->regs.x); }
         |                   ^~~
   arch/microblaze/kernel/signal.c:61:2: note: in expansion of macro 'COPY'
      61 |  COPY(r0);
         |  ^~~~


vim +/err +60 arch/microblaze/kernel/signal.c

2148daa9c45ff4 Michal Simek  2009-03-27  56  
353b431bafc42e Arnd Bergmann 2009-05-01  57  static int restore_sigcontext(struct pt_regs *regs,
353b431bafc42e Arnd Bergmann 2009-05-01  58  				struct sigcontext __user *sc, int *rval_p)
2148daa9c45ff4 Michal Simek  2009-03-27  59  {
2148daa9c45ff4 Michal Simek  2009-03-27 @60  #define COPY(x)		{err |= __get_user(regs->x, &sc->regs.x); }
2148daa9c45ff4 Michal Simek  2009-03-27  61  	COPY(r0);
2148daa9c45ff4 Michal Simek  2009-03-27  62  	COPY(r1);
2148daa9c45ff4 Michal Simek  2009-03-27  63  	COPY(r2);	COPY(r3);	COPY(r4);	COPY(r5);
2148daa9c45ff4 Michal Simek  2009-03-27  64  	COPY(r6);	COPY(r7);	COPY(r8);	COPY(r9);
2148daa9c45ff4 Michal Simek  2009-03-27  65  	COPY(r10);	COPY(r11);	COPY(r12);	COPY(r13);
2148daa9c45ff4 Michal Simek  2009-03-27  66  	COPY(r14);	COPY(r15);	COPY(r16);	COPY(r17);
2148daa9c45ff4 Michal Simek  2009-03-27  67  	COPY(r18);	COPY(r19);	COPY(r20);	COPY(r21);
2148daa9c45ff4 Michal Simek  2009-03-27  68  	COPY(r22);	COPY(r23);	COPY(r24);	COPY(r25);
2148daa9c45ff4 Michal Simek  2009-03-27  69  	COPY(r26);	COPY(r27);	COPY(r28);	COPY(r29);
2148daa9c45ff4 Michal Simek  2009-03-27  70  	COPY(r30);	COPY(r31);
2148daa9c45ff4 Michal Simek  2009-03-27  71  	COPY(pc);	COPY(ear);	COPY(esr);	COPY(fsr);
2148daa9c45ff4 Michal Simek  2009-03-27  72  #undef COPY
2148daa9c45ff4 Michal Simek  2009-03-27  73  
2148daa9c45ff4 Michal Simek  2009-03-27  74  	*rval_p = regs->r3;
2148daa9c45ff4 Michal Simek  2009-03-27  75  
3e5cd1e0be818f Yang Li       2021-03-10  76  	return 0;
2148daa9c45ff4 Michal Simek  2009-03-27  77  }
2148daa9c45ff4 Michal Simek  2009-03-27  78  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 26106 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-10 13:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-10  8:50 [PATCH] microblaze: remove unneeded variable 'err' Yang Li
2021-03-10  9:30 ` Michal Simek
2021-03-10 13:00 ` kernel test robot
2021-03-10 13:00   ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.