linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: at91_udc: Remove unneeded variable
@ 2019-06-05 14:12 Hariprasad Kelam
  0 siblings, 0 replies; only message in thread
From: Hariprasad Kelam @ 2019-06-05 14:12 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, Alan Stern, linux-usb, linux-kernel

at91_wakeup is always returning -EINVAL.

But usb_gadget_wakeup expects 0 on success and negative number on
failure. As per current implementation this function wont fail.

This patch removes unneeded variable and returns 0.

Issue identified by coccicheck

drivers/usb/gadget/udc/at91_udc.c:802:6-12:
Unneeded variable: "status". Return "- EINVAL" on line 821

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
 drivers/usb/gadget/udc/at91_udc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/udc/at91_udc.c b/drivers/usb/gadget/udc/at91_udc.c
index 03959dc..194ffb1 100644
--- a/drivers/usb/gadget/udc/at91_udc.c
+++ b/drivers/usb/gadget/udc/at91_udc.c
@@ -799,7 +799,6 @@ static int at91_wakeup(struct usb_gadget *gadget)
 {
 	struct at91_udc	*udc = to_udc(gadget);
 	u32		glbstate;
-	int		status = -EINVAL;
 	unsigned long	flags;
 
 	DBG("%s\n", __func__ );
@@ -818,7 +817,7 @@ static int at91_wakeup(struct usb_gadget *gadget)
 
 done:
 	spin_unlock_irqrestore(&udc->lock, flags);
-	return status;
+	return 0;
 }
 
 /* reinit == restore initial software state */
-- 
2.7.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-06-05 14:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-05 14:12 [PATCH] usb: gadget: at91_udc: Remove unneeded variable Hariprasad Kelam

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