[PATCH 0/5] treewide: fix unused-but-set warnings

STALE3714d

3 messages, 2 authors, 2016-06-16 · open the first message on its own page

[PATCH 0/5] treewide: fix unused-but-set warnings

From: arnd@arndb.de (Arnd Bergmann)
Date: 2016-06-16 11:38:21

I did some test-builds with W=1 and the -Wunused-but-set-variable
warnings appeared to be all fairly easy to address. In tons of
randconfig builds, I only found five instances.

The warning was originally disabled by Dave Jones when we hit
more instances with gcc-4.6, but apparently most of those have
gotten addressed anyway.

All five patches can be applied independently, and in each case,
the original code is not wrong, but the assignments are also useless,
so I'd consider this warning marginally useful.

I have a few other patch series for W=1 issues, and we can
consider turning those on by default once all the patches are
merged.

	Arnd

Arnd Bergmann (5):
  net: qlcnic: don't set unused function argument
  net: tlan: don't set unused function argument
  mic: remove unused function arg
  usb: pxa27x_udc: remove unused function argument
  fbmon: remove unused function argument

 drivers/misc/mic/scif/scif_dma.c                    | 6 ++----
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 1 -
 drivers/net/ethernet/ti/tlan.c                      | 1 -
 drivers/usb/gadget/udc/pxa27x_udc.c                 | 9 +++------
 drivers/video/fbdev/core/fbmon.c                    | 1 -
 5 files changed, 5 insertions(+), 13 deletions(-)

-- 
2.9.0
Cc: Sudeep Dutt <redacted>
Cc: Ashutosh Dixit <redacted>
Cc: Dept-GELinuxNICDev@qlogic.com
Cc: Samuel Chessman <chessman@tux.org>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Tomi Valkeinen <redacted>
Cc: netdev@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-usb@vger.kernel.org
Cc: linux-fbdev@vger.kernel.org
Cc: Dave Jones <redacted>

[PATCH 5/5] fbmon: remove unused function argument

From: Arnd Bergmann <arnd@arndb.de>
Date: 2016-06-16 11:41:40

When building with "make W=1", we get a warning about an
empty stub function that does nothing but reassign its one
of its arguments:

drivers/video/fbdev/core/fbmon.c: In function 'fb_edid_to_monspecs':
drivers/video/fbdev/core/fbmon.c:1497:67: error: parameter 'specs' set but not used [-Werror=unused-but-set-parameter]

We can simply make that function completely empty to avoid
the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/video/fbdev/core/fbmon.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
index 55e39e822b79..eaa6bab21839 100644
--- a/drivers/video/fbdev/core/fbmon.c
+++ b/drivers/video/fbdev/core/fbmon.c
@@ -1496,7 +1496,6 @@ int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var)
 }
 void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs)
 {
-	specs = NULL;
 }
 void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs)
 {
-- 
2.9.0

Re: [PATCH 5/5] fbmon: remove unused function argument

From: Tomi Valkeinen <hidden>
Date: 2016-06-16 12:58:06

On 16/06/16 14:38, Arnd Bergmann wrote:
quoted hunk
When building with "make W=1", we get a warning about an
empty stub function that does nothing but reassign its one
of its arguments:

drivers/video/fbdev/core/fbmon.c: In function 'fb_edid_to_monspecs':
drivers/video/fbdev/core/fbmon.c:1497:67: error: parameter 'specs' set but not used [-Werror=unused-but-set-parameter]

We can simply make that function completely empty to avoid
the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/video/fbdev/core/fbmon.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
index 55e39e822b79..eaa6bab21839 100644
--- a/drivers/video/fbdev/core/fbmon.c
+++ b/drivers/video/fbdev/core/fbmon.c
@@ -1496,7 +1496,6 @@ int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var)
 }
 void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs)
 {
-	specs = NULL;
 }
 void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs)
 {
Thanks, queued for 4.8.

 Tomi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help