diff mbox series

[2/2] usbip: Remove repeated setting of hcd->state in vhci_bus_resume()

Message ID 20190506125550.7826-2-suwan.kim027@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/2] usbip: Remove repeated setting of hcd->state in vhci_bus_suspend() | expand

Commit Message

Suwan Kim May 6, 2019, 12:55 p.m. UTC
When hcd resumes, hcd_bus_resume() calls vhci_bus_resume() which sets
hcd->state as HC_STATE_RUNNING. But after calling vhci_bus_resume(),
hcd_bus_resume() also sets hcd->state as HC_STATE_RUNNING. So, setting
hcd->state in vhci_hcd_resume() is unnecessary.

Signed-off-by: Suwan Kim <suwan.kim027@gmail.com>
---
 drivers/usb/usbip/vhci_hcd.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Shuah May 6, 2019, 3:16 p.m. UTC | #1
On 5/6/19 6:55 AM, Suwan Kim wrote:
> When hcd resumes, hcd_bus_resume() calls vhci_bus_resume() which sets
> hcd->state as HC_STATE_RUNNING. But after calling vhci_bus_resume(),
> hcd_bus_resume() also sets hcd->state as HC_STATE_RUNNING. So, setting
> hcd->state in vhci_hcd_resume() is unnecessary.
> 
> Signed-off-by: Suwan Kim <suwan.kim027@gmail.com>
> ---
>   drivers/usb/usbip/vhci_hcd.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
> index e6f378d00fb6..335d61676fb4 100644
> --- a/drivers/usb/usbip/vhci_hcd.c
> +++ b/drivers/usb/usbip/vhci_hcd.c
> @@ -1252,8 +1252,6 @@ static int vhci_bus_resume(struct usb_hcd *hcd)
>   	spin_lock_irqsave(&vhci->lock, flags);
>   	if (!HCD_HW_ACCESSIBLE(hcd))
>   		rc = -ESHUTDOWN;
> -	else
> -		hcd->state = HC_STATE_RUNNING;
>   	spin_unlock_irqrestore(&vhci->lock, flags);
>   
>   	return rc;
> 

Tell me more about why you think this change is needed? How did you test
this change?

thanks,
-- Shuah
diff mbox series

Patch

diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c
index e6f378d00fb6..335d61676fb4 100644
--- a/drivers/usb/usbip/vhci_hcd.c
+++ b/drivers/usb/usbip/vhci_hcd.c
@@ -1252,8 +1252,6 @@  static int vhci_bus_resume(struct usb_hcd *hcd)
 	spin_lock_irqsave(&vhci->lock, flags);
 	if (!HCD_HW_ACCESSIBLE(hcd))
 		rc = -ESHUTDOWN;
-	else
-		hcd->state = HC_STATE_RUNNING;
 	spin_unlock_irqrestore(&vhci->lock, flags);
 
 	return rc;