linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath10k: fix return value check in wake_tx_q op
@ 2018-05-06 13:25 Erik Stromdahl
  2018-05-12  9:03 ` Kalle Valo
       [not found] ` <6dc00772b826410e930306891fd13ed9@euamsexm01f.eu.qualcomm.com>
  0 siblings, 2 replies; 8+ messages in thread
From: Erik Stromdahl @ 2018-05-06 13:25 UTC (permalink / raw)
  To: kvalo, linux-wireless, ath10k; +Cc: Erik Stromdahl

ath10k_mac_tx_push_txq returns either a postive integer (length) on
success or a negative error code on error.

The "if (ret) break;" statement will thus always break out of the loop
immediately after ath10k_mac_tx_push_txq has returned (making the loop
pointless).

A side effect of this fix is that we will iterate the queue until
ath10k_mac_tx_push_txq returns -ENOENT. This will make sure the queue is
not added back to ar->txqs when it is empty. This could potentially
improve performance somewhat (I have seen a small improvement with SDIO
devices).

Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
---
 drivers/net/wireless/ath/ath10k/mac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 3d7119ad7c7a..487a7a7380fd 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -4290,7 +4290,7 @@ static void ath10k_mac_op_wake_tx_queue(struct ieee80211_hw *hw,
 
 	while (ath10k_mac_tx_can_push(hw, f_txq) && max--) {
 		ret = ath10k_mac_tx_push_txq(hw, f_txq);
-		if (ret)
+		if (ret < 0)
 			break;
 	}
 	if (ret != -ENOENT)
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-03-12  2:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-06 13:25 [PATCH] ath10k: fix return value check in wake_tx_q op Erik Stromdahl
2018-05-12  9:03 ` Kalle Valo
     [not found] ` <6dc00772b826410e930306891fd13ed9@euamsexm01f.eu.qualcomm.com>
     [not found]   ` <c77a1c0961f34ee68b7266444d2207f5@aptaiexm02e.ap.qualcomm.com>
2019-01-28  7:01     ` FW: [PATCH] " yiboz
2019-02-07 14:25       ` Kalle Valo
2019-02-25  4:40         ` Yibo Zhao
2019-03-04  1:56           ` Yibo Zhao
2019-03-11  6:44             ` Erik Stromdahl
2019-03-12  2:23               ` Yibo Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).