Skip to contentSkip to conversation

usb: gadget: at91_udc: Remove unneeded variable

PATCH New Hariprasad Kelam 1 participant 1 message Jun 5, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: gadget: at91_udc: Remove unneeded variable

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

---
 drivers/usb/gadget/udc/at91_udc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/usb/gadget/udc/at91_udc.c +1 -2
index 03959dc..194ffb1 100644
@@ -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 */
Signature · 1 line
2.7.4