diff options
author | Jia-Ju Bai <baijiaju1990@gmail.com> | 2018-04-10 10:37:06 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-22 16:49:42 +0300 |
commit | de0611b27d15ddc831d4c47d3b4be592c5587948 (patch) | |
tree | a818dd7639b2a8a03306fe6993e72ef3d3dcbc7a /drivers/usb/isp1760 | |
parent | 0f0290089abd37ca54db764c294fe7e47624a313 (diff) | |
download | linux-de0611b27d15ddc831d4c47d3b4be592c5587948.tar.xz |
usb: isp1760: Replace mdelay with msleep in isp1760_stop
isp1760_stop() is never called in atomic context.
The call chain ending up at isp1760_stop() is:
[1] isp1760_stop() <- isp1760_shutdown()
isp1760_shutdown() is set as ".shutdown" in struct hc_driver.
isp1760_stop() is also set as ".stop" in hc_driver.
These functions are not called in atomic context.
Despite never getting called from atomic context, isp1760_stop()
calls mdelay() to busily wait.
This is not necessary and can be replaced with msleep() to
avoid busy waiting.
This is found by a static analysis tool named DCNS written by myself.
And I also manually check it
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/isp1760')
-rw-r--r-- | drivers/usb/isp1760/isp1760-hcd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c index 42672d6ec525..1045521be293 100644 --- a/drivers/usb/isp1760/isp1760-hcd.c +++ b/drivers/usb/isp1760/isp1760-hcd.c @@ -2093,7 +2093,7 @@ static void isp1760_stop(struct usb_hcd *hcd) isp1760_hub_control(hcd, ClearPortFeature, USB_PORT_FEAT_POWER, 1, NULL, 0); - mdelay(20); + msleep(20); spin_lock_irq(&priv->lock); ehci_reset(hcd); |