Commit 6c93c63a authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Greg Kroah-Hartman

staging: rtl8192u: Replace mdelay with usleep_range in rtl8192_usb_disconnect

rtl8192_usb_disconnect() is never called in atomic context.

rtl8192_usb_disconnect() is only set as ".disconnect" in
struct usb_driver.

Despite never getting called from atomic context,
rtl8192_usb_disconnect() calls mdelay() to busily wait.
This is not necessary and can be replaced with usleep_range() 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: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a40c973e
...@@ -5035,7 +5035,7 @@ static void rtl8192_usb_disconnect(struct usb_interface *intf) ...@@ -5035,7 +5035,7 @@ static void rtl8192_usb_disconnect(struct usb_interface *intf)
kfree(priv->pFirmware); kfree(priv->pFirmware);
priv->pFirmware = NULL; priv->pFirmware = NULL;
rtl8192_usb_deleteendpoints(dev); rtl8192_usb_deleteendpoints(dev);
mdelay(10); usleep_range(10000, 11000);
} }
free_ieee80211(dev); free_ieee80211(dev);
RT_TRACE(COMP_DOWN, "wlan driver removed\n"); RT_TRACE(COMP_DOWN, "wlan driver removed\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment