linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] treewide: fix unused-but-set warnings
@ 2016-06-16 11:38 Arnd Bergmann
  2016-06-16 11:38 ` [PATCH 4/5] usb: pxa27x_udc: remove unused function argument Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2016-06-16 11:38 UTC (permalink / raw)
  To: linux-arm-kernel

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 <sudeep.dutt@intel.com>
Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Cc: Dept-GELinuxNICDev at qlogic.com
Cc: Samuel Chessman <chessman@tux.org>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: netdev at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-usb at vger.kernel.org
Cc: linux-fbdev at vger.kernel.org
Cc: Dave Jones <davej@codemonkey.org.uk>

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

* [PATCH 4/5] usb: pxa27x_udc: remove unused function argument
  2016-06-16 11:38 [PATCH 0/5] treewide: fix unused-but-set warnings Arnd Bergmann
@ 2016-06-16 11:38 ` Arnd Bergmann
  2016-06-16 17:56   ` Robert Jarzmik
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2016-06-16 11:38 UTC (permalink / raw)
  To: linux-arm-kernel

We get a warning for this when building with W=1 because the
argument gets assigned to something else but never read:

drivers/usb/gadget/udc/pxa27x_udc.c: In function 'stop_activity':
drivers/usb/gadget/udc/pxa27x_udc.c:1828:74: error: parameter 'driver' set but not used [-Werror=unused-but-set-parameter]

This remove the argument entirely.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/usb/gadget/udc/pxa27x_udc.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c
index 001a3b74a993..ad140aa00132 100644
--- a/drivers/usb/gadget/udc/pxa27x_udc.c
+++ b/drivers/usb/gadget/udc/pxa27x_udc.c
@@ -1825,13 +1825,10 @@ fail:
  * Disables all udc endpoints (even control endpoint), report disconnect to
  * the gadget user.
  */
-static void stop_activity(struct pxa_udc *udc, struct usb_gadget_driver *driver)
+static void stop_activity(struct pxa_udc *udc)
 {
 	int i;
 
-	/* don't disconnect drivers more than once */
-	if (udc->gadget.speed == USB_SPEED_UNKNOWN)
-		driver = NULL;
 	udc->gadget.speed = USB_SPEED_UNKNOWN;
 
 	for (i = 0; i < NR_USB_ENDPOINTS; i++)
@@ -1848,7 +1845,7 @@ static int pxa27x_udc_stop(struct usb_gadget *g)
 {
 	struct pxa_udc *udc = to_pxa(g);
 
-	stop_activity(udc, NULL);
+	stop_activity(udc);
 	udc_disable(udc);
 
 	udc->driver = NULL;
@@ -2296,7 +2293,7 @@ static void irq_udc_reset(struct pxa_udc *udc)
 
 	if ((udccr & UDCCR_UDA) == 0) {
 		dev_dbg(udc->dev, "USB reset start\n");
-		stop_activity(udc, udc->driver);
+		stop_activity(udc);
 	}
 	udc->gadget.speed = USB_SPEED_FULL;
 	memset(&udc->stats, 0, sizeof udc->stats);
-- 
2.9.0

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

* [PATCH 4/5] usb: pxa27x_udc: remove unused function argument
  2016-06-16 11:38 ` [PATCH 4/5] usb: pxa27x_udc: remove unused function argument Arnd Bergmann
@ 2016-06-16 17:56   ` Robert Jarzmik
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Jarzmik @ 2016-06-16 17:56 UTC (permalink / raw)
  To: linux-arm-kernel

Arnd Bergmann <arnd@arndb.de> writes:

> We get a warning for this when building with W=1 because the
> argument gets assigned to something else but never read:
>
> drivers/usb/gadget/udc/pxa27x_udc.c: In function 'stop_activity':
> drivers/usb/gadget/udc/pxa27x_udc.c:1828:74: error: parameter 'driver' set but not used [-Werror=unused-but-set-parameter]
>
> This remove the argument entirely.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Hi Arnd,

I wonder if it'd worth adding this ... even if the word "Completes" would be more
correct than "Fixes" :
Fixes: 70189a63d408 ("usb: gadget: pxa27x_udc: convert to udc_start/udc_stop")

Apart form that:
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

Cheers.

--
Robert

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

end of thread, other threads:[~2016-06-16 17:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-16 11:38 [PATCH 0/5] treewide: fix unused-but-set warnings Arnd Bergmann
2016-06-16 11:38 ` [PATCH 4/5] usb: pxa27x_udc: remove unused function argument Arnd Bergmann
2016-06-16 17:56   ` Robert Jarzmik

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).