summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mwifiex/wmm.c
diff options
context:
space:
mode:
authorYogesh Ashok Powar <yogeshp@marvell.com>2012-03-13 06:35:12 +0400
committerJohn W. Linville <linville@tuxdriver.com>2012-03-13 22:54:18 +0400
commitbb7de2bad5cb527e5fdc6b64d7f5d6e5009f2962 (patch)
tree9e04f783ffc2b0af2ed0ddb6de5e8438aedaac02 /drivers/net/wireless/mwifiex/wmm.c
parente7891ba2de9a67f22e5fd2a137f98d89cfb71348 (diff)
downloadlinux-bb7de2bad5cb527e5fdc6b64d7f5d6e5009f2962.tar.xz
mwifiex: rearrange if and else blocks to avoid extra indentation
This adds better readability. Signed-off-by: Yogesh Ashok Powar <yogeshp@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/wmm.c')
-rw-r--r--drivers/net/wireless/mwifiex/wmm.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c
index 5757ebd2163a..6f0cc210f79a 100644
--- a/drivers/net/wireless/mwifiex/wmm.c
+++ b/drivers/net/wireless/mwifiex/wmm.c
@@ -850,6 +850,7 @@ mwifiex_wmm_get_highest_priolist_ptr(struct mwifiex_adapter *adapter,
struct mwifiex_ra_list_tbl *ptr, *head;
struct mwifiex_bss_prio_node *bssprio_node, *bssprio_head;
struct mwifiex_tid_tbl *tid_ptr;
+ atomic_t *hqp;
int is_list_empty;
unsigned long flags;
int i, j;
@@ -879,12 +880,8 @@ mwifiex_wmm_get_highest_priolist_ptr(struct mwifiex_adapter *adapter,
}
do {
- atomic_t *hqp;
- spinlock_t *lock;
-
priv_tmp = bssprio_node->priv;
hqp = &priv_tmp->wmm.highest_queued_prio;
- lock = &priv_tmp->wmm.ra_list_spinlock;
for (i = atomic_read(hqp); i >= LOW_PRIO_TID; --i) {
@@ -923,16 +920,10 @@ mwifiex_wmm_get_highest_priolist_ptr(struct mwifiex_adapter *adapter,
do {
is_list_empty =
skb_queue_empty(&ptr->skb_head);
- if (!is_list_empty) {
- spin_lock_irqsave(lock, flags);
- if (atomic_read(hqp) > i)
- atomic_set(hqp, i);
- spin_unlock_irqrestore(lock,
- flags);
- *priv = priv_tmp;
- *tid = tos_to_tid[i];
- return ptr;
- }
+
+ if (!is_list_empty)
+ goto found;
+
/* Get next ra */
ptr = list_first_entry(&ptr->list,
struct mwifiex_ra_list_tbl,
@@ -969,6 +960,17 @@ mwifiex_wmm_get_highest_priolist_ptr(struct mwifiex_adapter *adapter,
} while (bssprio_node != bssprio_head);
}
return NULL;
+
+found:
+ spin_lock_irqsave(&priv_tmp->wmm.ra_list_spinlock, flags);
+ if (atomic_read(hqp) > i)
+ atomic_set(hqp, i);
+ spin_unlock_irqrestore(&priv_tmp->wmm.ra_list_spinlock, flags);
+
+ *priv = priv_tmp;
+ *tid = tos_to_tid[i];
+
+ return ptr;
}
/*