linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: udc:  remove redundant initial assignments to the pointer 's'
@ 2017-03-27 22:34 Colin King
  2017-03-27 23:37 ` YUAN Linyu
  2017-03-28 10:20 ` Sergei Shtylyov
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2017-03-27 22:34 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, yuan linyu, Bhumika Goyal,
	Michal Nazarewicz, linux-usb
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The initial setting of pointer s to the driver name or to the literal
string "(none)" is redundant as later it is always set to point to
a different literal string before it is printed log.  Remove this
redundant code.

Detected with CoverityScan, CID#1227032, CID#1227033 ("Unused Value")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/usb/gadget/udc/net2272.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c
index 8f85a51bd2b3..dee4eb60d4c2 100644
--- a/drivers/usb/gadget/udc/net2272.c
+++ b/drivers/usb/gadget/udc/net2272.c
@@ -1191,11 +1191,6 @@ registers_show(struct device *_dev, struct device_attribute *attr, char *buf)
 	size = PAGE_SIZE;
 	spin_lock_irqsave(&dev->lock, flags);
 
-	if (dev->driver)
-		s = dev->driver->driver.name;
-	else
-		s = "(none)";
-
 	/* Main Control Registers */
 	t = scnprintf(next, size, "%s version %s,"
 		"chiprev %02x, locctl %02x\n"
-- 
2.11.0

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

end of thread, other threads:[~2017-03-28 10:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-27 22:34 [PATCH] usb: gadget: udc: remove redundant initial assignments to the pointer 's' Colin King
2017-03-27 23:37 ` YUAN Linyu
2017-03-28 10:20 ` Sergei Shtylyov

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