Re: [PATCH] ssb: main.c: This patch removes unnecessary return statement using spatch tool
Hi Rahul, [auto build test WARNING on linus/master] [also build test WARNING on v4.10-rc2 next-20170106] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Rahul-Krishnan/ssb-main-c-This-patch-removes-unnecessary-return-statement-using-spatch-tool/20170107-205451 config: i386-randconfig-r0-201701 (attached as .config) compiler: gcc-5 (Debian 5.4.1-2) 5.4.1 20160904 reproduce: # save the attached .config to linux build tree make ARCH=i386 All warnings (new ones prefixed by >>): drivers/ssb/main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '/' token patch /home/rahul/git/kernels/staging/drivers//* ^ drivers/ssb/main.c:6:43: error: stray '@' in program * Copyright 2006, 2007, Michael Buesch^ In file included from include/linux/ioport.h:12:0, from include/linux/device.h:16, from include/linux/ssb/ssb.h:4, from drivers/ssb/ssb_private.h:4, from drivers/ssb/main.c:11: >> include/linux/compiler.h:110:34: warning: 'struct ftrace_branch_data' >> declared inside parameter list void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); ^ >> include/linux/compiler.h:110:34: warning: its scope is only this definition >> or declaration, which is probably not what you want include/linux/err.h: In function 'IS_ERR': include/linux/compiler.h:117:18: error: variable '__f' has initializer but incomplete type static struct ftrace_branch_data \ ^ include/linux/compiler.h:139:58: note: in expansion of macro '__branch_check__' # define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0)) ^ include/linux/err.h:21:25: note: in expansion of macro 'unlikely' #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) ^ include/linux/err.h:35:9: note: in expansion of macro 'IS_ERR_VALUE' return IS_ERR_VALUE((unsigned long)ptr); ^ include/linux/compiler.h:117:18: error: unknown field 'func' specified in initializer static struct ftrace_branch_data \ ^ include/linux/compiler.h:139:58: note: in expansion of macro '__branch_check__' # define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0)) ^ include/linux/err.h:21:25: note: in expansion of macro 'unlikely' #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) ^ include/linux/err.h:35:9: note: in expansion of macro 'IS_ERR_VALUE' return IS_ERR_VALUE((unsigned long)ptr); ^ include/linux/compiler.h:121:13: warning: excess elements in struct initializer .func = __func__, \ ^ include/linux/compiler.h:139:58: note: in expansion of macro '__branch_check__' # define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0)) ^ include/linux/err.h:21:25: note: in expansion of macro 'unlikely' #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) ^ include/linux/err.h:35:9: note: in expansion of macro 'IS_ERR_VALUE' return IS_ERR_VALUE((unsigned long)ptr); ^ include/linux/compiler.h:121:13: note: (near initialization for '__f') .func = __func__, \ ^ include/linux/compiler.h:139:58: note: in expansion of macro '__branch_check__' # define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0)) ^ include/linux/err.h:21:25: note: in expansion of macro 'unlikely' #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) ^ include/linux/err.h:35:9: note: in expansion of macro 'IS_ERR_VALUE' return IS_ERR_VALUE((unsigned long)ptr); ^ include/linux/compiler.h:117:18: error: unknown field 'file' specified in initializer static struct ftrace_branch_data \ ^ include/linux/compiler.h:139:58: note: in expansion of macro '__branch_check__' # define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0)) ^ include/linux/err.h:21:25: note: in expansion of macro 'unlikely' #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
Re: [PATCH] ssb: main.c: This patch removes unnecessary return statement using spatch tool
Hi Rahul, [auto build test WARNING on linus/master] [also build test WARNING on v4.10-rc2 next-20170106] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Rahul-Krishnan/ssb-main-c-This-patch-removes-unnecessary-return-statement-using-spatch-tool/20170107-205451 config: i386-randconfig-r0-201701 (attached as .config) compiler: gcc-5 (Debian 5.4.1-2) 5.4.1 20160904 reproduce: # save the attached .config to linux build tree make ARCH=i386 All warnings (new ones prefixed by >>): drivers/ssb/main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '/' token patch /home/rahul/git/kernels/staging/drivers//* ^ drivers/ssb/main.c:6:43: error: stray '@' in program * Copyright 2006, 2007, Michael Buesch ^ In file included from include/linux/ioport.h:12:0, from include/linux/device.h:16, from include/linux/ssb/ssb.h:4, from drivers/ssb/ssb_private.h:4, from drivers/ssb/main.c:11: >> include/linux/compiler.h:110:34: warning: 'struct ftrace_branch_data' >> declared inside parameter list void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); ^ >> include/linux/compiler.h:110:34: warning: its scope is only this definition >> or declaration, which is probably not what you want include/linux/err.h: In function 'IS_ERR': include/linux/compiler.h:117:18: error: variable '__f' has initializer but incomplete type static struct ftrace_branch_data \ ^ include/linux/compiler.h:139:58: note: in expansion of macro '__branch_check__' # define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0)) ^ include/linux/err.h:21:25: note: in expansion of macro 'unlikely' #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) ^ include/linux/err.h:35:9: note: in expansion of macro 'IS_ERR_VALUE' return IS_ERR_VALUE((unsigned long)ptr); ^ include/linux/compiler.h:117:18: error: unknown field 'func' specified in initializer static struct ftrace_branch_data \ ^ include/linux/compiler.h:139:58: note: in expansion of macro '__branch_check__' # define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0)) ^ include/linux/err.h:21:25: note: in expansion of macro 'unlikely' #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) ^ include/linux/err.h:35:9: note: in expansion of macro 'IS_ERR_VALUE' return IS_ERR_VALUE((unsigned long)ptr); ^ include/linux/compiler.h:121:13: warning: excess elements in struct initializer .func = __func__, \ ^ include/linux/compiler.h:139:58: note: in expansion of macro '__branch_check__' # define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0)) ^ include/linux/err.h:21:25: note: in expansion of macro 'unlikely' #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) ^ include/linux/err.h:35:9: note: in expansion of macro 'IS_ERR_VALUE' return IS_ERR_VALUE((unsigned long)ptr); ^ include/linux/compiler.h:121:13: note: (near initialization for '__f') .func = __func__, \ ^ include/linux/compiler.h:139:58: note: in expansion of macro '__branch_check__' # define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0)) ^ include/linux/err.h:21:25: note: in expansion of macro 'unlikely' #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) ^ include/linux/err.h:35:9: note: in expansion of macro 'IS_ERR_VALUE' return IS_ERR_VALUE((unsigned long)ptr); ^ include/linux/compiler.h:117:18: error: unknown field 'file' specified in initializer static struct ftrace_branch_data \ ^ include/linux/compiler.h:139:58: note: in expansion of macro '__branch_check__' # define unlikely(x) (__builtin_constant_p(x) ? !!(x) : __branch_check__(x, 0)) ^ include/linux/err.h:21:25: note: in expansion of macro 'unlikely' #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO) ^
Re: [PATCH] ssb: main.c: This patch removes unnecessary return statement using spatch tool
Hi Rahul, [auto build test ERROR on linus/master] [also build test ERROR on v4.10-rc2 next-20170106] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Rahul-Krishnan/ssb-main-c-This-patch-removes-unnecessary-return-statement-using-spatch-tool/20170107-205451 config: x86_64-randconfig-x008-201701 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): >> drivers/ssb/main.c:1:8: error: expected '=', ',', ';', 'asm' or >> '__attribute__' before '/' token patch /home/rahul/git/kernels/staging/drivers//* ^ >> drivers/ssb/main.c:6:43: error: stray '@' in program * Copyright 2006, 2007, Michael Buesch^ vim +1 drivers/ssb/main.c > 1 patch /home/rahul/git/kernels/staging/drivers//* 2 * Sonics Silicon Backplane 3 * Subsystem core 4 * 5 * Copyright 2005, Broadcom Corporation > 6 * Copyright 2006, 2007, Michael Buesch 7 * 8 * Licensed under the GNU/GPL. See COPYING for details. 9 */ --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: [PATCH] ssb: main.c: This patch removes unnecessary return statement using spatch tool
Hi Rahul, [auto build test ERROR on linus/master] [also build test ERROR on v4.10-rc2 next-20170106] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Rahul-Krishnan/ssb-main-c-This-patch-removes-unnecessary-return-statement-using-spatch-tool/20170107-205451 config: x86_64-randconfig-x008-201701 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): >> drivers/ssb/main.c:1:8: error: expected '=', ',', ';', 'asm' or >> '__attribute__' before '/' token patch /home/rahul/git/kernels/staging/drivers//* ^ >> drivers/ssb/main.c:6:43: error: stray '@' in program * Copyright 2006, 2007, Michael Buesch ^ vim +1 drivers/ssb/main.c > 1 patch /home/rahul/git/kernels/staging/drivers//* 2 * Sonics Silicon Backplane 3 * Subsystem core 4 * 5 * Copyright 2005, Broadcom Corporation > 6 * Copyright 2006, 2007, Michael Buesch 7 * 8 * Licensed under the GNU/GPL. See COPYING for details. 9 */ --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: [PATCH] ssb: main.c: This patch removes unnecessary return statement using spatch tool
Hi Rahul, On Sat, Jan 7, 2017 at 2:20 AM, Rahul Krishnanwrote: > This patch removes unnecessary return statement using spatch. This doesn't describe the patch. > Signed-off-by: Rahul Krishnan > --- > drivers/ssb/main.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c > index d1a7507..ae3b7fe 100644 > --- a/drivers/ssb/main.c > +++ b/drivers/ssb/main.c > @@ -1,4 +1,4 @@ > -/* > + patch /home/rahul/git/kernels/staging/drivers//* What is the purpose of this change, won't this cause the file to fail to compile? > * Sonics Silicon Backplane > * Subsystem core > * > @@ -1272,9 +1272,7 @@ u32 ssb_admatch_size(u32 adm) > default: > SSB_WARN_ON(1); > } > - size = (1 << (size + 1)); > - > - return size; > + return (1 << (size + 1)); Is the size variable used elsewhere? If not, it's declaration should probably be removed. Also, there should be a blank line before the return statement. Thanks, -- Julian Calaby Email: julian.cal...@gmail.com Profile: http://www.google.com/profiles/julian.calaby/
Re: [PATCH] ssb: main.c: This patch removes unnecessary return statement using spatch tool
Hi Rahul, On Sat, Jan 7, 2017 at 2:20 AM, Rahul Krishnan wrote: > This patch removes unnecessary return statement using spatch. This doesn't describe the patch. > Signed-off-by: Rahul Krishnan > --- > drivers/ssb/main.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c > index d1a7507..ae3b7fe 100644 > --- a/drivers/ssb/main.c > +++ b/drivers/ssb/main.c > @@ -1,4 +1,4 @@ > -/* > + patch /home/rahul/git/kernels/staging/drivers//* What is the purpose of this change, won't this cause the file to fail to compile? > * Sonics Silicon Backplane > * Subsystem core > * > @@ -1272,9 +1272,7 @@ u32 ssb_admatch_size(u32 adm) > default: > SSB_WARN_ON(1); > } > - size = (1 << (size + 1)); > - > - return size; > + return (1 << (size + 1)); Is the size variable used elsewhere? If not, it's declaration should probably be removed. Also, there should be a blank line before the return statement. Thanks, -- Julian Calaby Email: julian.cal...@gmail.com Profile: http://www.google.com/profiles/julian.calaby/
Re: [PATCH] ssb: main.c: This patch removes unnecessary return statement using spatch tool
> > @@ -1272,9 +1272,7 @@ u32 ssb_admatch_size(u32 adm) > > default: > > SSB_WARN_ON(1); > > } > > - size = (1 << (size + 1)); > > - > > - return size; > > + return (1 << (size + 1)); > > } > > EXPORT_SYMBOL(ssb_admatch_size); I'm all for cleaning up code, but I don't really see how this change improves the code. -- Michael pgpBI7CSf1jSC.pgp Description: OpenPGP digital signature
Re: [PATCH] ssb: main.c: This patch removes unnecessary return statement using spatch tool
> > @@ -1272,9 +1272,7 @@ u32 ssb_admatch_size(u32 adm) > > default: > > SSB_WARN_ON(1); > > } > > - size = (1 << (size + 1)); > > - > > - return size; > > + return (1 << (size + 1)); > > } > > EXPORT_SYMBOL(ssb_admatch_size); I'm all for cleaning up code, but I don't really see how this change improves the code. -- Michael pgpBI7CSf1jSC.pgp Description: OpenPGP digital signature
Re: [PATCH] ssb: main.c: This patch removes unnecessary return statement using spatch tool
On 6 January 2017 at 23:39, Rafał Miłeckiwrote: > On 6 January 2017 at 16:20, Rahul Krishnan wrote: >> This patch removes unnecessary return statement using spatch. >> Signed-off-by: Rahul Krishnan Also an extra line break above Signed-off-by is preferred. Look at "git log" to get am overview.
Re: [PATCH] ssb: main.c: This patch removes unnecessary return statement using spatch tool
On 6 January 2017 at 23:39, Rafał Miłecki wrote: > On 6 January 2017 at 16:20, Rahul Krishnan wrote: >> This patch removes unnecessary return statement using spatch. >> Signed-off-by: Rahul Krishnan Also an extra line break above Signed-off-by is preferred. Look at "git log" to get am overview.
Re: [PATCH] ssb: main.c: This patch removes unnecessary return statement using spatch tool
Hi Rahul, On 6 January 2017 at 16:20, Rahul Krishnanwrote: > This patch removes unnecessary return statement using spatch. > Signed-off-by: Rahul Krishnan Please work on simplifying & making topic more accurate. You can drop "main.c:" and "This patch". I don't think this patch really "removes unnecessary return". It looks like you just dropped assignment/calculation done just before returning value. That "using spatch tool" part is also misleading. You don't really use that tool for removing it. More likely it was noticed/suggested that that tool you use. Please use commit message for describing your change and don't just copy & paste topic. You can e.g. put into about "spatch" there (instead of the topic). > @@ -1,4 +1,4 @@ > -/* > + patch /home/rahul/git/kernels/staging/drivers//* > * Sonics Silicon Backplane > * Subsystem core > * Huh? Looks definitely wrong and I don't think it even compiles anymore! Make sure to compile code after your change, to make sure it does & there isn't any new warning. > @@ -1272,9 +1272,7 @@ u32 ssb_admatch_size(u32 adm) > default: > SSB_WARN_ON(1); > } > - size = (1 << (size + 1)); > - > - return size; > + return (1 << (size + 1)); > } > EXPORT_SYMBOL(ssb_admatch_size); Please rework your patch, *test it* and resend V2. -- Rafał
Re: [PATCH] ssb: main.c: This patch removes unnecessary return statement using spatch tool
Hi Rahul, On 6 January 2017 at 16:20, Rahul Krishnan wrote: > This patch removes unnecessary return statement using spatch. > Signed-off-by: Rahul Krishnan Please work on simplifying & making topic more accurate. You can drop "main.c:" and "This patch". I don't think this patch really "removes unnecessary return". It looks like you just dropped assignment/calculation done just before returning value. That "using spatch tool" part is also misleading. You don't really use that tool for removing it. More likely it was noticed/suggested that that tool you use. Please use commit message for describing your change and don't just copy & paste topic. You can e.g. put into about "spatch" there (instead of the topic). > @@ -1,4 +1,4 @@ > -/* > + patch /home/rahul/git/kernels/staging/drivers//* > * Sonics Silicon Backplane > * Subsystem core > * Huh? Looks definitely wrong and I don't think it even compiles anymore! Make sure to compile code after your change, to make sure it does & there isn't any new warning. > @@ -1272,9 +1272,7 @@ u32 ssb_admatch_size(u32 adm) > default: > SSB_WARN_ON(1); > } > - size = (1 << (size + 1)); > - > - return size; > + return (1 << (size + 1)); > } > EXPORT_SYMBOL(ssb_admatch_size); Please rework your patch, *test it* and resend V2. -- Rafał
[PATCH] ssb: main.c: This patch removes unnecessary return statement using spatch tool
This patch removes unnecessary return statement using spatch. Signed-off-by: Rahul Krishnan--- drivers/ssb/main.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c index d1a7507..ae3b7fe 100644 --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c @@ -1,4 +1,4 @@ -/* + patch /home/rahul/git/kernels/staging/drivers//* * Sonics Silicon Backplane * Subsystem core * @@ -1272,9 +1272,7 @@ u32 ssb_admatch_size(u32 adm) default: SSB_WARN_ON(1); } - size = (1 << (size + 1)); - - return size; + return (1 << (size + 1)); } EXPORT_SYMBOL(ssb_admatch_size); -- 2.7.4
[PATCH] ssb: main.c: This patch removes unnecessary return statement using spatch tool
This patch removes unnecessary return statement using spatch. Signed-off-by: Rahul Krishnan --- drivers/ssb/main.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c index d1a7507..ae3b7fe 100644 --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c @@ -1,4 +1,4 @@ -/* + patch /home/rahul/git/kernels/staging/drivers//* * Sonics Silicon Backplane * Subsystem core * @@ -1272,9 +1272,7 @@ u32 ssb_admatch_size(u32 adm) default: SSB_WARN_ON(1); } - size = (1 << (size + 1)); - - return size; + return (1 << (size + 1)); } EXPORT_SYMBOL(ssb_admatch_size); -- 2.7.4