Commit f7091bc6 authored by navin patidar's avatar navin patidar Committed by Greg Kroah-Hartman

staging: rtl8188eu: Replace _rtw_queue_empty() with list_empty()

Signed-off-by: default avatarnavin patidar <navin.patidar@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5f223b95
...@@ -85,7 +85,7 @@ u8 rtw_do_join(struct adapter *padapter) ...@@ -85,7 +85,7 @@ u8 rtw_do_join(struct adapter *padapter)
pmlmepriv->to_join = true; pmlmepriv->to_join = true;
if (_rtw_queue_empty(queue)) { if (list_empty(&queue->queue)) {
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
......
...@@ -149,7 +149,7 @@ struct wlan_network *_rtw_dequeue_network(struct __queue *queue) ...@@ -149,7 +149,7 @@ struct wlan_network *_rtw_dequeue_network(struct __queue *queue)
spin_lock_bh(&queue->lock); spin_lock_bh(&queue->lock);
if (_rtw_queue_empty(queue)) { if (list_empty(&queue->queue)) {
pnetwork = NULL; pnetwork = NULL;
} else { } else {
pnetwork = container_of((&queue->queue)->next, struct wlan_network, list); pnetwork = container_of((&queue->queue)->next, struct wlan_network, list);
...@@ -170,7 +170,7 @@ struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)/* _queue *f ...@@ -170,7 +170,7 @@ struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)/* _queue *f
spin_lock_bh(&free_queue->lock); spin_lock_bh(&free_queue->lock);
if (_rtw_queue_empty(free_queue) == true) { if (list_empty(&free_queue->queue)) {
pnetwork = NULL; pnetwork = NULL;
goto exit; goto exit;
} }
...@@ -535,7 +535,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t ...@@ -535,7 +535,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
/* If we didn't find a match, then get a new network slot to initialize /* If we didn't find a match, then get a new network slot to initialize
* with this beacon's information */ * with this beacon's information */
if (phead == plist) { if (phead == plist) {
if (_rtw_queue_empty(&(pmlmepriv->free_bss_pool)) == true) { if (list_empty(&(pmlmepriv->free_bss_pool.queue))) {
/* If there are no more slots, expire the oldest */ /* If there are no more slots, expire the oldest */
pnetwork = oldest; pnetwork = oldest;
......
...@@ -131,7 +131,7 @@ struct recv_frame *_rtw_alloc_recvframe (struct __queue *pfree_recv_queue) ...@@ -131,7 +131,7 @@ struct recv_frame *_rtw_alloc_recvframe (struct __queue *pfree_recv_queue)
struct adapter *padapter; struct adapter *padapter;
struct recv_priv *precvpriv; struct recv_priv *precvpriv;
if (_rtw_queue_empty(pfree_recv_queue)) { if (list_empty(&pfree_recv_queue->queue)) {
hdr = NULL; hdr = NULL;
} else { } else {
phead = get_list_head(pfree_recv_queue); phead = get_list_head(pfree_recv_queue);
...@@ -1563,7 +1563,7 @@ struct recv_frame *recvframe_chk_defrag(struct adapter *padapter, ...@@ -1563,7 +1563,7 @@ struct recv_frame *recvframe_chk_defrag(struct adapter *padapter,
if (pdefrag_q != NULL) { if (pdefrag_q != NULL) {
if (fragnum == 0) { if (fragnum == 0) {
/* the first fragment */ /* the first fragment */
if (_rtw_queue_empty(pdefrag_q) == false) { if (!list_empty(&pdefrag_q->queue)) {
/* free current defrag_q */ /* free current defrag_q */
rtw_free_recvframe_queue(pdefrag_q, pfree_recv_queue); rtw_free_recvframe_queue(pdefrag_q, pfree_recv_queue);
} }
......
...@@ -223,7 +223,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) ...@@ -223,7 +223,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
spin_lock_bh(&(pfree_sta_queue->lock)); spin_lock_bh(&(pfree_sta_queue->lock));
if (_rtw_queue_empty(pfree_sta_queue) == true) { if (list_empty(&pfree_sta_queue->queue)) {
spin_unlock_bh(&pfree_sta_queue->lock); spin_unlock_bh(&pfree_sta_queue->lock);
psta = NULL; psta = NULL;
} else { } else {
......
...@@ -901,10 +901,10 @@ s32 rtw_txframes_pending(struct adapter *padapter) ...@@ -901,10 +901,10 @@ s32 rtw_txframes_pending(struct adapter *padapter)
{ {
struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
return ((_rtw_queue_empty(&pxmitpriv->be_pending) == false) || return (!list_empty(&pxmitpriv->be_pending.queue) ||
(_rtw_queue_empty(&pxmitpriv->bk_pending) == false) || !list_empty(&pxmitpriv->bk_pending.queue) ||
(_rtw_queue_empty(&pxmitpriv->vi_pending) == false) || !list_empty(&pxmitpriv->vi_pending.queue) ||
(_rtw_queue_empty(&pxmitpriv->vo_pending) == false)); !list_empty(&pxmitpriv->vo_pending.queue));
} }
s32 rtw_txframes_sta_ac_pending(struct adapter *padapter, struct pkt_attrib *pattrib) s32 rtw_txframes_sta_ac_pending(struct adapter *padapter, struct pkt_attrib *pattrib)
...@@ -1222,7 +1222,7 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv) ...@@ -1222,7 +1222,7 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv)
spin_lock_irqsave(&pfree_queue->lock, irql); spin_lock_irqsave(&pfree_queue->lock, irql);
if (_rtw_queue_empty(pfree_queue) == true) { if (list_empty(&pfree_queue->queue)) {
pxmitbuf = NULL; pxmitbuf = NULL;
} else { } else {
phead = get_list_head(pfree_queue); phead = get_list_head(pfree_queue);
...@@ -1286,7 +1286,7 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv) ...@@ -1286,7 +1286,7 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv)
spin_lock_irqsave(&pfree_xmitbuf_queue->lock, irql); spin_lock_irqsave(&pfree_xmitbuf_queue->lock, irql);
if (_rtw_queue_empty(pfree_xmitbuf_queue) == true) { if (list_empty(&pfree_xmitbuf_queue->queue)) {
pxmitbuf = NULL; pxmitbuf = NULL;
} else { } else {
phead = get_list_head(pfree_xmitbuf_queue); phead = get_list_head(pfree_xmitbuf_queue);
...@@ -1369,7 +1369,7 @@ struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)/* _queue *pf ...@@ -1369,7 +1369,7 @@ struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)/* _queue *pf
spin_lock_bh(&pfree_xmit_queue->lock); spin_lock_bh(&pfree_xmit_queue->lock);
if (_rtw_queue_empty(pfree_xmit_queue) == true) { if (list_empty(&pfree_xmit_queue->queue)) {
RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_alloc_xmitframe:%d\n", pxmitpriv->free_xmitframe_cnt)); RT_TRACE(_module_rtl871x_xmit_c_, _drv_info_, ("rtw_alloc_xmitframe:%d\n", pxmitpriv->free_xmitframe_cnt));
pxframe = NULL; pxframe = NULL;
} else { } else {
...@@ -1539,7 +1539,7 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi ...@@ -1539,7 +1539,7 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi
phwxmit->accnt--; phwxmit->accnt--;
/* Remove sta node when there are no pending packets. */ /* Remove sta node when there are no pending packets. */
if (_rtw_queue_empty(pframe_queue)) /* must be done after get_next and before break */ if (list_empty(&pframe_queue->queue)) /* must be done after get_next and before break */
list_del_init(&ptxservq->tx_pending); list_del_init(&ptxservq->tx_pending);
goto exit; goto exit;
} }
......
...@@ -583,7 +583,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp ...@@ -583,7 +583,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp
} }
} /* end while (aggregate same priority and same DA(AP or STA) frames) */ } /* end while (aggregate same priority and same DA(AP or STA) frames) */
if (_rtw_queue_empty(&ptxservq->sta_pending) == true) if (list_empty(&ptxservq->sta_pending.queue))
list_del_init(&ptxservq->tx_pending); list_del_init(&ptxservq->tx_pending);
spin_unlock_bh(&pxmitpriv->lock); spin_unlock_bh(&pxmitpriv->lock);
......
...@@ -171,7 +171,6 @@ void _rtw_memcpy(void *dec, void *sour, u32 sz); ...@@ -171,7 +171,6 @@ void _rtw_memcpy(void *dec, void *sour, u32 sz);
u32 _rtw_down_sema(struct semaphore *sema); u32 _rtw_down_sema(struct semaphore *sema);
void _rtw_init_queue(struct __queue *pqueue); void _rtw_init_queue(struct __queue *pqueue);
u32 _rtw_queue_empty(struct __queue *pqueue);
u32 rtw_systime_to_ms(u32 systime); u32 rtw_systime_to_ms(u32 systime);
u32 rtw_ms_to_systime(u32 ms); u32 rtw_ms_to_systime(u32 ms);
......
...@@ -77,11 +77,6 @@ void _rtw_init_queue(struct __queue *pqueue) ...@@ -77,11 +77,6 @@ void _rtw_init_queue(struct __queue *pqueue)
spin_lock_init(&(pqueue->lock)); spin_lock_init(&(pqueue->lock));
} }
u32 _rtw_queue_empty(struct __queue *pqueue)
{
return list_empty(&(pqueue->queue));
}
inline u32 rtw_systime_to_ms(u32 systime) inline u32 rtw_systime_to_ms(u32 systime)
{ {
return systime * 1000 / HZ; return systime * 1000 / HZ;
......
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