diff mbox series

carl9170: remove dead branch in op_conf_tx callback

Message ID 20190615100009.14654-1-chunkeey@gmail.com (mailing list archive)
State Accepted
Commit 4ba641262b91e4b360564b646ad0ff2166b07ade
Delegated to: Kalle Valo
Headers show
Series carl9170: remove dead branch in op_conf_tx callback | expand

Commit Message

Christian Lamparter June 15, 2019, 10 a.m. UTC
This patch removes the error branch for (queue > ar->hw->queues).
It is no longer needed anymore as the "queue" value is validated by
cfg80211's parse_txq_params() before the driver code gets called.

Some background:
In the old days (linux 2.6 and early 3.x), the parse_txq_params()
function did not verify the "queue" value. That's why these drivers
had to do it.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
---
 drivers/net/wireless/ath/carl9170/main.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Comments

Kalle Valo June 27, 2019, 5:48 p.m. UTC | #1
Christian Lamparter <chunkeey@gmail.com> wrote:

> This patch removes the error branch for (queue > ar->hw->queues).
> It is no longer needed anymore as the "queue" value is validated by
> cfg80211's parse_txq_params() before the driver code gets called.
> 
> Some background:
> In the old days (linux 2.6 and early 3.x), the parse_txq_params()
> function did not verify the "queue" value. That's why these drivers
> had to do it.
> 
> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

4ba641262b91 carl9170: remove dead branch in op_conf_tx callback
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c
index 7f1bdea742b8..40a8054f8aa6 100644
--- a/drivers/net/wireless/ath/carl9170/main.c
+++ b/drivers/net/wireless/ath/carl9170/main.c
@@ -1387,13 +1387,8 @@  static int carl9170_op_conf_tx(struct ieee80211_hw *hw,
 	int ret;
 
 	mutex_lock(&ar->mutex);
-	if (queue < ar->hw->queues) {
-		memcpy(&ar->edcf[ar9170_qmap[queue]], param, sizeof(*param));
-		ret = carl9170_set_qos(ar);
-	} else {
-		ret = -EINVAL;
-	}
-
+	memcpy(&ar->edcf[ar9170_qmap[queue]], param, sizeof(*param));
+	ret = carl9170_set_qos(ar);
 	mutex_unlock(&ar->mutex);
 	return ret;
 }