Commit 849fb0a8 authored by James A Shackleford's avatar James A Shackleford Committed by Greg Kroah-Hartman
Browse files

staging: rtl8712: remove wrapper function get_next



get_next is just an inline wrapper around return list->next.  This
patch removes the wrapper and directly uses list->next where
applicable.

Signed-off-by: default avatarJames A Shackleford <shack@linux.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 29197b7c
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -58,11 +58,6 @@ struct __queue {
		spin_lock_init(&((pqueue)->lock));	\
	} while (0)

static inline struct list_head *get_next(struct list_head *list)
{
	return list->next;
}

static inline struct list_head *get_list_head(struct  __queue *queue)
{
	return &(queue->queue);
+7 −7
Original line number Diff line number Diff line
@@ -209,7 +209,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter,

	pfree_recv_queue = &adapter->recvpriv.free_recv_queue;
	phead = get_list_head(defrag_q);
	plist = get_next(phead);
	plist = phead->next;
	prframe = LIST_CONTAINOR(plist, union recv_frame, u);
	list_del_init(&prframe->u.list);
	pfhdr = &prframe->u.hdr;
@@ -223,7 +223,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter,
	}
	curfragnum++;
	plist = get_list_head(defrag_q);
	plist = get_next(plist);
	plist = plist->next;
	data = get_recvframe_data(prframe);
	while (end_of_queue_search(phead, plist) == false) {
		pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u);
@@ -247,7 +247,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter,
		memcpy(pfhdr->rx_tail, pnfhdr->rx_data, pnfhdr->len);
		recvframe_put(prframe, pnfhdr->len);
		pfhdr->attrib.icv_len = pnfhdr->attrib.icv_len;
		plist = get_next(plist);
		plist = plist->next;
	}
	/* free the defrag_q queue and return the prframe */
	r8712_free_recvframe_queue(defrag_q, pfree_recv_queue);
@@ -500,12 +500,12 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl,
	struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;

	phead = get_list_head(ppending_recvframe_queue);
	plist = get_next(phead);
	plist = phead->next;
	while (end_of_queue_search(phead, plist) == false) {
		pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u);
		pnextattrib = &pnextrframe->u.hdr.attrib;
		if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num))
			plist = get_next(plist);
			plist = plist->next;
		else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num))
			return false;
		else
@@ -529,7 +529,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter,
			 &preorder_ctrl->pending_recvframe_queue;

	phead = get_list_head(ppending_recvframe_queue);
	plist = get_next(phead);
	plist = phead->next;
	/* Handling some condition for forced indicate case.*/
	if (bforced == true) {
		if (list_empty(phead))
@@ -546,7 +546,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter,
		prframe = LIST_CONTAINOR(plist, union recv_frame, u);
		pattrib = &prframe->u.hdr.attrib;
		if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) {
			plist = get_next(plist);
			plist = plist->next;
			list_del_init(&(prframe->u.hdr.list));
			if (SN_EQUAL(preorder_ctrl->indicate_seq,
			    pattrib->seq_num))
+6 −4
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv,
	struct	xmit_frame *pxmitframe = NULL;

	xmitframe_phead = get_list_head(pframe_queue);
	xmitframe_plist = get_next(xmitframe_phead);
	xmitframe_plist = xmitframe_phead->next;
	if ((end_of_queue_search(xmitframe_phead, xmitframe_plist)) == false) {
		pxmitframe = LIST_CONTAINOR(xmitframe_plist,
			     struct xmit_frame, list);
@@ -211,7 +211,7 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv,
	for (i = 0; i < entry; i++) {
		phwxmit = phwxmit_i + inx[i];
		sta_phead = get_list_head(phwxmit->sta_queue);
		sta_plist = get_next(sta_phead);
		sta_plist = sta_phead->next;
		while ((end_of_queue_search(sta_phead, sta_plist)) == false) {
			ptxservq = LIST_CONTAINOR(sta_plist, struct tx_servq,
				  tx_pending);
@@ -222,10 +222,12 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv,
				phwxmit->accnt--;
				goto exit_dequeue_xframe_ex;
			}
			sta_plist = get_next(sta_plist);
			sta_plist = sta_plist->next;
			/*Remove sta node when there are no pending packets.*/
			if (_queue_empty(pframe_queue)) {
				/*must be done after get_next and before break*/
				/* must be done after sta_plist->next
				 * and before break
				 */
				list_del_init(&ptxservq->tx_pending);
			}
		}
+1 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ static struct cmd_obj *_dequeue_cmd(struct __queue *queue)
	if (list_empty(&(queue->queue)))
		obj = NULL;
	else {
		obj = LIST_CONTAINOR(get_next(&(queue->queue)),
		obj = LIST_CONTAINOR(queue->queue.next,
				     struct cmd_obj, list);
		list_del_init(&obj->list);
	}
+8 −8
Original line number Diff line number Diff line
@@ -1079,13 +1079,13 @@ static int r8711_wx_set_wap(struct net_device *dev,
	authmode = padapter->securitypriv.ndisauthtype;
	spin_lock_irqsave(&queue->lock, irqL);
	phead = get_list_head(queue);
	pmlmepriv->pscanned = get_next(phead);
	pmlmepriv->pscanned = phead->next;
	while (1) {
		if (end_of_queue_search(phead, pmlmepriv->pscanned) == true)
			break;
		pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned,
			   struct wlan_network, list);
		pmlmepriv->pscanned = get_next(pmlmepriv->pscanned);
		pmlmepriv->pscanned = pmlmepriv->pscanned->next;
		dst_bssid = pnetwork->network.MacAddress;
		if (!memcmp(dst_bssid, temp->sa_data, ETH_ALEN)) {
			r8712_set_802_11_infrastructure_mode(padapter,
@@ -1228,7 +1228,7 @@ static int r8711_wx_get_scan(struct net_device *dev,
	}
	spin_lock_irqsave(&queue->lock, irqL);
	phead = get_list_head(queue);
	plist = get_next(phead);
	plist = phead->next;
	while (1) {
		if (end_of_queue_search(phead, plist) == true)
			break;
@@ -1238,7 +1238,7 @@ static int r8711_wx_get_scan(struct net_device *dev,
		}
		pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
		ev = translate_scan(padapter, a, pnetwork, ev, stop);
		plist = get_next(plist);
		plist = plist->next;
	}
	spin_unlock_irqrestore(&queue->lock, irqL);
	wrqu->data.length = ev - extra;
@@ -1287,13 +1287,13 @@ static int r8711_wx_set_essid(struct net_device *dev,
		memcpy(ndis_ssid.Ssid, extra, len);
		src_ssid = ndis_ssid.Ssid;
		phead = get_list_head(queue);
		pmlmepriv->pscanned = get_next(phead);
		pmlmepriv->pscanned = phead->next;
		while (1) {
			if (end_of_queue_search(phead, pmlmepriv->pscanned))
				break;
			pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned,
				   struct wlan_network, list);
			pmlmepriv->pscanned = get_next(pmlmepriv->pscanned);
			pmlmepriv->pscanned = pmlmepriv->pscanned->next;
			dst_ssid = pnetwork->network.Ssid.Ssid;
			if ((!memcmp(dst_ssid, src_ssid, ndis_ssid.SsidLength))
			    && (pnetwork->network.Ssid.SsidLength ==
@@ -2003,7 +2003,7 @@ static int r871x_get_ap_info(struct net_device *dev,
		 return -EINVAL;
	spin_lock_irqsave(&(pmlmepriv->scanned_queue.lock), irqL);
	phead = get_list_head(queue);
	plist = get_next(phead);
	plist = phead->next;
	while (1) {
		if (end_of_queue_search(phead, plist) == true)
			break;
@@ -2031,7 +2031,7 @@ static int r871x_get_ap_info(struct net_device *dev,
				break;
			}
		}
		plist = get_next(plist);
		plist = plist->next;
	}
	spin_unlock_irqrestore(&(pmlmepriv->scanned_queue.lock), irqL);
	if (pdata->length >= 34) {
Loading