summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mwifiex/11n.c
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2014-03-08 07:41:29 +0400
committerJohn W. Linville <linville@tuxdriver.com>2014-03-14 22:49:14 +0400
commit63410c37d2d25a63968029a9cd6b324ac6b3a2c9 (patch)
tree6aeda89bc20497ade487e1f07d61fa8ce1713af2 /drivers/net/wireless/mwifiex/11n.c
parentc44379e2f9a21154e0d15e33f69bf970a596233a (diff)
downloadlinux-63410c37d2d25a63968029a9cd6b324ac6b3a2c9.tar.xz
mwifiex: code rearrangement for better readability
Use negative check for 'status' and return from the function. This improves readability by avoiding line splits. Also, local variable is used for start window calculations. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/11n.c')
-rw-r--r--drivers/net/wireless/mwifiex/11n.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/wireless/mwifiex/11n.c b/drivers/net/wireless/mwifiex/11n.c
index 79ead928a64e..ebc4cf648e15 100644
--- a/drivers/net/wireless/mwifiex/11n.c
+++ b/drivers/net/wireless/mwifiex/11n.c
@@ -166,21 +166,21 @@ int mwifiex_ret_11n_addba_req(struct mwifiex_private *priv,
tid = (le16_to_cpu(add_ba_rsp->block_ack_param_set)
& IEEE80211_ADDBA_PARAM_TID_MASK)
>> BLOCKACKPARAM_TID_POS;
- if (le16_to_cpu(add_ba_rsp->status_code) == BA_RESULT_SUCCESS) {
- tx_ba_tbl = mwifiex_get_ba_tbl(priv, tid,
- add_ba_rsp->peer_mac_addr);
- if (tx_ba_tbl) {
- dev_dbg(priv->adapter->dev, "info: BA stream complete\n");
- tx_ba_tbl->ba_status = BA_SETUP_COMPLETE;
- } else {
- dev_err(priv->adapter->dev, "BA stream not created\n");
- }
- } else {
+ if (le16_to_cpu(add_ba_rsp->status_code) != BA_RESULT_SUCCESS) {
mwifiex_del_ba_tbl(priv, tid, add_ba_rsp->peer_mac_addr,
TYPE_DELBA_SENT, true);
if (add_ba_rsp->add_rsp_result != BA_RESULT_TIMEOUT)
priv->aggr_prio_tbl[tid].ampdu_ap =
BA_STREAM_NOT_ALLOWED;
+ return 0;
+ }
+
+ tx_ba_tbl = mwifiex_get_ba_tbl(priv, tid, add_ba_rsp->peer_mac_addr);
+ if (tx_ba_tbl) {
+ dev_dbg(priv->adapter->dev, "info: BA stream complete\n");
+ tx_ba_tbl->ba_status = BA_SETUP_COMPLETE;
+ } else {
+ dev_err(priv->adapter->dev, "BA stream not created\n");
}
return 0;