diff options
author | Jia-Ju Bai <baijiaju1990@gmail.com> | 2018-04-10 20:25:34 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-23 15:51:34 +0200 |
commit | 72cbd314bc79ba105d9e0184e4b00b2cf6f3b42d (patch) | |
tree | 331a685733fdb2e47c0c93b59b7fde1acf0e16c5 /drivers | |
parent | 6c93c63a634ae7036d699a1e7f2121a9f2dee5fe (diff) |
staging: rtl8192u: Replace mdelay with usleep_range in dm_TXPowerTrackingCallback_TSSI
dm_TXPowerTrackingCallback_TSSI() is never called in atomic context.
dm_TXPowerTrackingCallback_TSSI() is only called by
dm_txpower_trackingcallback(), which is set a parameter of
INIT_DELAYED_WORK() in rtl8192_init_priv_task().
Despite never getting called from atomic context,
dm_TXPowerTrackingCallback_TSSI() 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: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_dm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index e1b81d34f1ad..e25b058dec26 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -539,13 +539,13 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) rtStatus = SendTxCommandPacket(dev, &tx_cmd, 12); if (rtStatus == RT_STATUS_FAILURE) RT_TRACE(COMP_POWER_TRACKING, "Set configuration with tx cmd queue fail!\n"); - mdelay(1); + usleep_range(1000, 2000); /*DbgPrint("hi, vivi, strange\n");*/ for (i = 0; i <= 30; i++) { read_nic_byte(dev, 0x1ba, &Pwr_Flag); if (Pwr_Flag == 0) { - mdelay(1); + usleep_range(1000, 2000); continue; } read_nic_word(dev, 0x13c, &Avg_TSSI_Meas); |