diff mbox series

ath: move spin_lock_bh to spin_lock in tasklet

Message ID 20190119105530.6079-1-qq282012236@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series ath: move spin_lock_bh to spin_lock in tasklet | expand

Commit Message

Zhiwei Jiang Jan. 19, 2019, 10:55 a.m. UTC
as you are already in a tasklet, it is unnecessary to call
spin_lock_bh, because softirq already disable BH.

Signed-off-by: Zhiwei Jiang <qq282012236@gmail.com>
---
 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Dan Carpenter Jan. 22, 2019, 12:59 p.m. UTC | #1
Hi Zhiwei,

Thank you for the patch! Perhaps something to improve:

url:    https://github.com/0day-ci/linux/commits/Zhiwei-Jiang/ath-move-spin_lock_bh-to-spin_lock-in-tasklet/20190121-185529
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master

smatch warnings:
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c:584 ath9k_tx_failed_tasklet() warn: inconsistent returns 'bottom_half:'.
  Locked on:   line 584
  Unlocked on: line 580

# https://github.com/0day-ci/linux/commit/953929a8fc22ae7ab9adafed62c84a11c4be2270
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 953929a8fc22ae7ab9adafed62c84a11c4be2270
vim +584 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c

27876a29 Sujith Manoharan 2011-04-13  572  
27876a29 Sujith Manoharan 2011-04-13  573  void ath9k_tx_failed_tasklet(unsigned long data)
27876a29 Sujith Manoharan 2011-04-13  574  {
27876a29 Sujith Manoharan 2011-04-13  575  	struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *)data;
b587fc81 Sujith Manoharan 2011-04-13  576  
953929a8 Zhiwei Jiang     2019-01-19  577  	spin_lock(&priv->tx.tx_lock);
27876a29 Sujith Manoharan 2011-04-13  578  	if (priv->tx.flags & ATH9K_HTC_OP_TX_DRAIN) {
27876a29 Sujith Manoharan 2011-04-13  579  		spin_unlock_bh(&priv->tx.tx_lock);
                                                                   ^^^
Missed this one.

27876a29 Sujith Manoharan 2011-04-13  580  		return;
b587fc81 Sujith Manoharan 2011-04-13  581  	}
953929a8 Zhiwei Jiang     2019-01-19  582  	spin_unlock(&priv->tx.tx_lock);
b587fc81 Sujith Manoharan 2011-04-13  583  
27876a29 Sujith Manoharan 2011-04-13 @584  	ath9k_htc_tx_drainq(priv, &priv->tx.tx_failed);
b587fc81 Sujith Manoharan 2011-04-13  585  }
27876a29 Sujith Manoharan 2011-04-13  586  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index 799010ed04e0..4e38276ed0d3 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -574,12 +574,12 @@  void ath9k_tx_failed_tasklet(unsigned long data)
 {
 	struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *)data;
 
-	spin_lock_bh(&priv->tx.tx_lock);
+	spin_lock(&priv->tx.tx_lock);
 	if (priv->tx.flags & ATH9K_HTC_OP_TX_DRAIN) {
 		spin_unlock_bh(&priv->tx.tx_lock);
 		return;
 	}
-	spin_unlock_bh(&priv->tx.tx_lock);
+	spin_unlock(&priv->tx.tx_lock);
 
 	ath9k_htc_tx_drainq(priv, &priv->tx.tx_failed);
 }