lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191216170302.29543-38-Jerome.Pouiller@silabs.com>
Date:   Mon, 16 Dec 2019 17:03:52 +0000
From:   Jérôme Pouiller <Jerome.Pouiller@...abs.com>
To:     "devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
        "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Kalle Valo <kvalo@...eaurora.org>,
        "David S . Miller" <davem@...emloft.net>,
        Jérôme Pouiller <Jerome.Pouiller@...abs.com>
Subject: [PATCH 37/55] staging: wfx: simplify wfx_conf_tx()

From: Jérôme Pouiller <jerome.pouiller@...abs.com>

Error management of wfx_conf_tx() can be simplified.

In add, the hardware command "hif_set_edca_queue_params" never returns
any error.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@...abs.com>
---
 drivers/staging/wfx/sta.c | 42 ++++++++++++++-------------------------
 1 file changed, 15 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 42b0d01d85cc..045d3916ada8 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -370,39 +370,27 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 {
 	struct wfx_dev *wdev = hw->priv;
 	struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv;
-	int ret = 0;
 	struct hif_req_edca_queue_params *edca;
 
+	WARN_ON(queue >= hw->queues);
+
 	mutex_lock(&wdev->conf_mutex);
+	wvif->edca.uapsd_enable[queue] = params->uapsd;
+	edca = &wvif->edca.params[queue];
+	edca->aifsn = params->aifs;
+	edca->cw_min = params->cw_min;
+	edca->cw_max = params->cw_max;
+	edca->tx_op_limit = params->txop * TXOP_UNIT;
+	edca->allowed_medium_time = 0;
+	hif_set_edca_queue_params(wvif, edca);
 
-	if (queue < hw->queues) {
-		edca = &wvif->edca.params[queue];
-
-		wvif->edca.uapsd_enable[queue] = params->uapsd;
-		edca->aifsn = params->aifs;
-		edca->cw_min = params->cw_min;
-		edca->cw_max = params->cw_max;
-		edca->tx_op_limit = params->txop * TXOP_UNIT;
-		edca->allowed_medium_time = 0;
-		ret = hif_set_edca_queue_params(wvif, edca);
-		if (ret) {
-			ret = -EINVAL;
-			goto out;
-		}
-
-		if (wvif->vif->type == NL80211_IFTYPE_STATION) {
-			ret = wfx_set_uapsd_param(wvif, &wvif->edca);
-			if (!ret && wvif->setbssparams_done &&
-			    wvif->state == WFX_STATE_STA)
-				ret = wfx_update_pm(wvif);
-		}
-	} else {
-		ret = -EINVAL;
+	if (wvif->vif->type == NL80211_IFTYPE_STATION) {
+		wfx_set_uapsd_param(wvif, &wvif->edca);
+		if (wvif->setbssparams_done && wvif->state == WFX_STATE_STA)
+			wfx_update_pm(wvif);
 	}
-
-out:
 	mutex_unlock(&wdev->conf_mutex);
-	return ret;
+	return 0;
 }
 
 int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value)
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ