USB: dwc2: drop irq-flags initialisations
authorJohan Hovold <johan@kernel.org>
Wed, 19 May 2021 09:33:02 +0000 (11:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 May 2021 18:05:56 +0000 (20:05 +0200)
There's no need to initialise irq-flags variables before saving the
interrupt state.

While at it drop two redundant return-value initialisations from two of
the functions that got it wrong.

Cc: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210519093303.10789-3-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc2/gadget.c

index 184964174dc0c0f1723b6376c495ee862e94b2d4..b16fb3611a869c59506f9fa8ccf1eff21b192455 100644 (file)
@@ -1496,8 +1496,8 @@ static int dwc2_hsotg_ep_queue_lock(struct usb_ep *ep, struct usb_request *req,
 {
        struct dwc2_hsotg_ep *hs_ep = our_ep(ep);
        struct dwc2_hsotg *hs = hs_ep->parent;
-       unsigned long flags = 0;
-       int ret = 0;
+       unsigned long flags;
+       int ret;
 
        spin_lock_irqsave(&hs->lock, flags);
        ret = dwc2_hsotg_ep_queue(ep, req, gfp_flags);
@@ -4374,8 +4374,8 @@ static int dwc2_hsotg_ep_sethalt_lock(struct usb_ep *ep, int value)
 {
        struct dwc2_hsotg_ep *hs_ep = our_ep(ep);
        struct dwc2_hsotg *hs = hs_ep->parent;
-       unsigned long flags = 0;
-       int ret = 0;
+       unsigned long flags;
+       int ret;
 
        spin_lock_irqsave(&hs->lock, flags);
        ret = dwc2_hsotg_ep_sethalt(ep, value, false);
@@ -4505,7 +4505,7 @@ err:
 static int dwc2_hsotg_udc_stop(struct usb_gadget *gadget)
 {
        struct dwc2_hsotg *hsotg = to_hsotg(gadget);
-       unsigned long flags = 0;
+       unsigned long flags;
        int ep;
 
        if (!hsotg)
@@ -4577,7 +4577,7 @@ static int dwc2_hsotg_set_selfpowered(struct usb_gadget *gadget,
 static int dwc2_hsotg_pullup(struct usb_gadget *gadget, int is_on)
 {
        struct dwc2_hsotg *hsotg = to_hsotg(gadget);
-       unsigned long flags = 0;
+       unsigned long flags;
 
        dev_dbg(hsotg->dev, "%s: is_on: %d op_state: %d\n", __func__, is_on,
                hsotg->op_state);