linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] CFLAGS: add -Wunused-but-set-parameter
@ 2016-07-07 21:43 Alexey Dobriyan
  2016-07-11 10:13 ` kbuild test robot
  2016-07-12 21:26 ` Andrew Morton
  0 siblings, 2 replies; 4+ messages in thread
From: Alexey Dobriyan @ 2016-07-07 21:43 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

-Wunused-but-set-parameter is finding stuff with current allmodconfig:

drivers/misc/mic/scif/scif_dma.c:118:27: warning: parameter 'ep' set but not used [-Wunused-but-set-parameter]
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c:2156:8: warning: parameter 'function' set but not used [-Wunused-but-set-parameter]
drivers/net/ethernet/ti/tlan.c:1647:59: warning: parameter 'host_int' set but not used [-Wunused-but-set-parameter]
drivers/usb/gadget/udc/pxa27x_udc.c:1828:74: warning: parameter 'driver' set but not used [-Wunused-but-set-parameter]

and judging by changelogs, people were using it before,
but were too scared to touch top level Makefile.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 Makefile |    1 +
 1 file changed, 1 insertion(+)

--- a/Makefile
+++ b/Makefile
@@ -399,6 +399,7 @@ KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
 		   -Werror-implicit-function-declaration \
 		   -Wno-format-security \
 		   -std=gnu89
+KBUILD_CFLAGS += -Wunused-but-set-parameter
 
 KBUILD_AFLAGS_KERNEL :=
 KBUILD_CFLAGS_KERNEL :=

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

* Re: [PATCH] CFLAGS: add -Wunused-but-set-parameter
  2016-07-07 21:43 [PATCH] CFLAGS: add -Wunused-but-set-parameter Alexey Dobriyan
@ 2016-07-11 10:13 ` kbuild test robot
  2016-07-12 21:26 ` Andrew Morton
  1 sibling, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2016-07-11 10:13 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: kbuild-all, akpm, linux-kernel

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

Hi,

[auto build test WARNING on kbuild/for-next]
[also build test WARNING on v4.7-rc7 next-20160708]
[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/Alexey-Dobriyan/CFLAGS-add-Wunused-but-set-parameter/20160708-055418
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild.git for-next
config: m68k-sun3_defconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=m68k 

All warnings (new ones prefixed by >>):

   drivers/video/fbdev/core/fbmon.c: In function 'fb_edid_to_monspecs':
>> drivers/video/fbdev/core/fbmon.c:1497:67: warning: parameter 'specs' set but not used [-Wunused-but-set-parameter]
    void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs)
                                                                      ^

vim +/specs +1497 drivers/video/fbdev/core/fbmon.c

79089044 drivers/video/fbmon.c Steffen Trumtrar      2012-11-14  1481  
79089044 drivers/video/fbmon.c Steffen Trumtrar      2012-11-14  1482  	pr_debug("%s: got %dx%d display mode from %s\n",
79089044 drivers/video/fbmon.c Steffen Trumtrar      2012-11-14  1483  		of_node_full_name(np), vm.hactive, vm.vactive, np->name);
79089044 drivers/video/fbmon.c Steffen Trumtrar      2012-11-14  1484  	dump_fb_videomode(fb);
79089044 drivers/video/fbmon.c Steffen Trumtrar      2012-11-14  1485  
79089044 drivers/video/fbmon.c Steffen Trumtrar      2012-11-14  1486  	return 0;
79089044 drivers/video/fbmon.c Steffen Trumtrar      2012-11-14  1487  }
79089044 drivers/video/fbmon.c Steffen Trumtrar      2012-11-14  1488  EXPORT_SYMBOL_GPL(of_get_fb_videomode);
a38884f6 drivers/video/fbmon.c Tomi Valkeinen        2013-03-12  1489  #endif /* CONFIG_OF */
a38884f6 drivers/video/fbmon.c Tomi Valkeinen        2013-03-12  1490  #endif /* CONFIG_VIDEOMODE_HELPERS */
79089044 drivers/video/fbmon.c Steffen Trumtrar      2012-11-14  1491  
^1da177e drivers/video/fbmon.c Linus Torvalds        2005-04-16  1492  #else
^1da177e drivers/video/fbmon.c Linus Torvalds        2005-04-16  1493  int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var)
^1da177e drivers/video/fbmon.c Linus Torvalds        2005-04-16  1494  {
^1da177e drivers/video/fbmon.c Linus Torvalds        2005-04-16  1495  	return 1;
^1da177e drivers/video/fbmon.c Linus Torvalds        2005-04-16  1496  }
^1da177e drivers/video/fbmon.c Linus Torvalds        2005-04-16 @1497  void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs)
^1da177e drivers/video/fbmon.c Linus Torvalds        2005-04-16  1498  {
^1da177e drivers/video/fbmon.c Linus Torvalds        2005-04-16  1499  	specs = NULL;
^1da177e drivers/video/fbmon.c Linus Torvalds        2005-04-16  1500  }
e4105119 drivers/video/fbmon.c Guennadi Liakhovetski 2010-11-11  1501  void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs)
e4105119 drivers/video/fbmon.c Guennadi Liakhovetski 2010-11-11  1502  {
e4105119 drivers/video/fbmon.c Guennadi Liakhovetski 2010-11-11  1503  }
^1da177e drivers/video/fbmon.c Linus Torvalds        2005-04-16  1504  void fb_destroy_modedb(struct fb_videomode *modedb)
^1da177e drivers/video/fbmon.c Linus Torvalds        2005-04-16  1505  {

:::::: The code at line 1497 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 11721 bytes --]

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

* Re: [PATCH] CFLAGS: add -Wunused-but-set-parameter
  2016-07-07 21:43 [PATCH] CFLAGS: add -Wunused-but-set-parameter Alexey Dobriyan
  2016-07-11 10:13 ` kbuild test robot
@ 2016-07-12 21:26 ` Andrew Morton
  2016-07-13 19:06   ` [PATCH v2] " Alexey Dobriyan
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2016-07-12 21:26 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: linux-kernel

On Fri, 8 Jul 2016 00:43:06 +0300 Alexey Dobriyan <adobriyan@gmail.com> wrote:

> -Wunused-but-set-parameter is finding stuff with current allmodconfig:
> 
> drivers/misc/mic/scif/scif_dma.c:118:27: warning: parameter 'ep' set but not used [-Wunused-but-set-parameter]
> drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c:2156:8: warning: parameter 'function' set but not used [-Wunused-but-set-parameter]
> drivers/net/ethernet/ti/tlan.c:1647:59: warning: parameter 'host_int' set but not used [-Wunused-but-set-parameter]
> drivers/usb/gadget/udc/pxa27x_udc.c:1828:74: warning: parameter 'driver' set but not used [-Wunused-but-set-parameter]
> 
> and judging by changelogs, people were using it before,
> but were too scared to touch top level Makefile.
>
> ...
>
> --- a/Makefile
> +++ b/Makefile
> @@ -399,6 +399,7 @@ KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
>  		   -Werror-implicit-function-declaration \
>  		   -Wno-format-security \
>  		   -std=gnu89
> +KBUILD_CFLAGS += -Wunused-but-set-parameter
>  
>  KBUILD_AFLAGS_KERNEL :=
>  KBUILD_CFLAGS_KERNEL :=

gcc-4.4.4:

  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CC      scripts/mod/empty.o
  CC      scripts/mod/devicetable-offsets.s
cc1: error: unrecognized command line option "-Wunused-but-set-parameter"
make[2]: *** [scripts/mod/empty.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cc1: error: unrecognized command line option "-Wunused-but-set-parameter"
make[2]: *** [scripts/mod/devicetable-offsets.s] Error 1

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

* [PATCH v2] CFLAGS: add -Wunused-but-set-parameter
  2016-07-12 21:26 ` Andrew Morton
@ 2016-07-13 19:06   ` Alexey Dobriyan
  0 siblings, 0 replies; 4+ messages in thread
From: Alexey Dobriyan @ 2016-07-13 19:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

-Wunused-but-set-parameter is finding stuff with current allmodconfig:

drivers/misc/mic/scif/scif_dma.c:118:27: warning: parameter 'ep' set but not used [-Wunused-but-set-parameter]
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c:2156:8: warning: parameter 'function' set but not used [-Wunused-but-set-parameter]
drivers/net/ethernet/ti/tlan.c:1647:59: warning: parameter 'host_int' set but not used [-Wunused-but-set-parameter]
drivers/usb/gadget/udc/pxa27x_udc.c:1828:74: warning: parameter 'driver' set but not used [-Wunused-but-set-parameter]

and judging by changelogs, people were using it before,
but were too scared to change top level Makefile.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

	Can't compile gcc that old :-(

 Makefile |    3 +++
 1 file changed, 3 insertions(+)

--- a/Makefile
+++ b/Makefile
@@ -796,6 +796,9 @@ KBUILD_CFLAGS   += $(call cc-option,-Werror=date-time)
 # enforce correct pointer usage
 KBUILD_CFLAGS   += $(call cc-option,-Werror=incompatible-pointer-types)
 
+# dead code
+KBUILD_CFLAGS += $(call cc-option,-Wunused-but-set-parameter,)
+
 # use the deterministic mode of AR if available
 KBUILD_ARFLAGS := $(call ar-option,D)
 

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

end of thread, other threads:[~2016-07-13 19:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-07 21:43 [PATCH] CFLAGS: add -Wunused-but-set-parameter Alexey Dobriyan
2016-07-11 10:13 ` kbuild test robot
2016-07-12 21:26 ` Andrew Morton
2016-07-13 19:06   ` [PATCH v2] " Alexey Dobriyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).