Commit 01926202 authored by Shawn Lin's avatar Shawn Lin Committed by Kalle Valo

mwifiex: simplify the code around ra_list

We don't need to check if the list is empty separately
as we could use list_first_entry_or_null to cover it.
Signed-off-by: default avatarShawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: default avatarBrian Norris <briannorris@chromium.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 4f8e2545
...@@ -55,11 +55,8 @@ static void mwifiex_restore_tdls_packets(struct mwifiex_private *priv, ...@@ -55,11 +55,8 @@ static void mwifiex_restore_tdls_packets(struct mwifiex_private *priv,
tx_info->flags |= MWIFIEX_BUF_FLAG_TDLS_PKT; tx_info->flags |= MWIFIEX_BUF_FLAG_TDLS_PKT;
} else { } else {
tid_list = &priv->wmm.tid_tbl_ptr[tid_down].ra_list; tid_list = &priv->wmm.tid_tbl_ptr[tid_down].ra_list;
if (!list_empty(tid_list)) ra_list = list_first_entry_or_null(tid_list,
ra_list = list_first_entry(tid_list, struct mwifiex_ra_list_tbl, list);
struct mwifiex_ra_list_tbl, list);
else
ra_list = NULL;
tx_info->flags &= ~MWIFIEX_BUF_FLAG_TDLS_PKT; tx_info->flags &= ~MWIFIEX_BUF_FLAG_TDLS_PKT;
} }
......
...@@ -868,12 +868,8 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv, ...@@ -868,12 +868,8 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv,
return; return;
default: default:
list_head = priv->wmm.tid_tbl_ptr[tid_down].ra_list; list_head = priv->wmm.tid_tbl_ptr[tid_down].ra_list;
if (!list_empty(&list_head)) ra_list = list_first_entry_or_null(&list_head,
ra_list = list_first_entry( struct mwifiex_ra_list_tbl, list);
&list_head, struct mwifiex_ra_list_tbl,
list);
else
ra_list = NULL;
break; break;
} }
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment