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

staging: rtl8712: remove function get_list_head



get_list_head is an inline that returns &list->head.  This patch removes this
inline and directly applies &list->head where applicable.

Signed-off-by: default avatarJames A Shackleford <shack@linux.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 849fb0a8
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_list_head(struct  __queue *queue)
{
	return &(queue->queue);
}

#define LIST_CONTAINOR(ptr, type, member) \
	((type *)((char *)(ptr)-(SIZE_T)(&((type *)0)->member)))

+7 −8
Original line number Diff line number Diff line
@@ -146,8 +146,7 @@ int r8712_free_recvframe(union recv_frame *precvframe,
	}
	spin_lock_irqsave(&pfree_recv_queue->lock, irqL);
	list_del_init(&(precvframe->u.hdr.list));
	list_add_tail(&(precvframe->u.hdr.list),
			 get_list_head(pfree_recv_queue));
	list_add_tail(&(precvframe->u.hdr.list), &pfree_recv_queue->queue);
	if (padapter != NULL) {
		if (pfree_recv_queue == &precvpriv->free_recv_queue)
				precvpriv->free_recvframe_cnt++;
@@ -208,7 +207,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter,
	struct  __queue	*pfree_recv_queue;

	pfree_recv_queue = &adapter->recvpriv.free_recv_queue;
	phead = get_list_head(defrag_q);
	phead = &defrag_q->queue;
	plist = phead->next;
	prframe = LIST_CONTAINOR(plist, union recv_frame, u);
	list_del_init(&prframe->u.list);
@@ -222,7 +221,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter,
		return NULL;
	}
	curfragnum++;
	plist = get_list_head(defrag_q);
	plist = &defrag_q->queue;
	plist = plist->next;
	data = get_recvframe_data(prframe);
	while (end_of_queue_search(phead, plist) == false) {
@@ -296,7 +295,7 @@ union recv_frame *r8712_recvframe_chk_defrag(struct _adapter *padapter,
				}
			}
			/* Then enqueue the 0~(n-1) fragment to the defrag_q */
			phead = get_list_head(pdefrag_q);
			phead = &pdefrag_q->queue;
			list_add_tail(&pfhdr->list, phead);
			prtnframe = NULL;
		} else {
@@ -311,7 +310,7 @@ union recv_frame *r8712_recvframe_chk_defrag(struct _adapter *padapter,
		/* the last fragment frame
		 * enqueue the last fragment */
		if (pdefrag_q != NULL) {
			phead = get_list_head(pdefrag_q);
			phead = &pdefrag_q->queue;
			list_add_tail(&pfhdr->list, phead);
			/*call recvframe_defrag to defrag*/
			precv_frame = recvframe_defrag(padapter, pdefrag_q);
@@ -499,7 +498,7 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl,
					&preorder_ctrl->pending_recvframe_queue;
	struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;

	phead = get_list_head(ppending_recvframe_queue);
	phead = &ppending_recvframe_queue->queue;
	plist = phead->next;
	while (end_of_queue_search(phead, plist) == false) {
		pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u);
@@ -528,7 +527,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter,
	struct  __queue *ppending_recvframe_queue =
			 &preorder_ctrl->pending_recvframe_queue;

	phead = get_list_head(ppending_recvframe_queue);
	phead = &ppending_recvframe_queue->queue;
	plist = phead->next;
	/* Handling some condition for forced indicate case.*/
	if (bforced == true) {
+2 −2
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv,
	struct list_head *xmitframe_plist, *xmitframe_phead;
	struct	xmit_frame *pxmitframe = NULL;

	xmitframe_phead = get_list_head(pframe_queue);
	xmitframe_phead = &pframe_queue->queue;
	xmitframe_plist = xmitframe_phead->next;
	if ((end_of_queue_search(xmitframe_phead, xmitframe_plist)) == false) {
		pxmitframe = LIST_CONTAINOR(xmitframe_plist,
@@ -210,7 +210,7 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv,
	spin_lock_irqsave(&pxmitpriv->lock, irqL0);
	for (i = 0; i < entry; i++) {
		phwxmit = phwxmit_i + inx[i];
		sta_phead = get_list_head(phwxmit->sta_queue);
		sta_phead = &phwxmit->sta_queue->queue;
		sta_plist = sta_phead->next;
		while ((end_of_queue_search(sta_phead, sta_plist)) == false) {
			ptxservq = LIST_CONTAINOR(sta_plist, struct tx_servq,
+4 −4
Original line number Diff line number Diff line
@@ -1078,7 +1078,7 @@ static int r8711_wx_set_wap(struct net_device *dev,
		return -EINVAL;
	authmode = padapter->securitypriv.ndisauthtype;
	spin_lock_irqsave(&queue->lock, irqL);
	phead = get_list_head(queue);
	phead = &queue->queue;
	pmlmepriv->pscanned = phead->next;
	while (1) {
		if (end_of_queue_search(phead, pmlmepriv->pscanned) == true)
@@ -1227,7 +1227,7 @@ static int r8711_wx_get_scan(struct net_device *dev,
			break;
	}
	spin_lock_irqsave(&queue->lock, irqL);
	phead = get_list_head(queue);
	phead = &queue->queue;
	plist = phead->next;
	while (1) {
		if (end_of_queue_search(phead, plist) == true)
@@ -1286,7 +1286,7 @@ static int r8711_wx_set_essid(struct net_device *dev,
		ndis_ssid.SsidLength = len;
		memcpy(ndis_ssid.Ssid, extra, len);
		src_ssid = ndis_ssid.Ssid;
		phead = get_list_head(queue);
		phead = &queue->queue;
		pmlmepriv->pscanned = phead->next;
		while (1) {
			if (end_of_queue_search(phead, pmlmepriv->pscanned))
@@ -2002,7 +2002,7 @@ static int r871x_get_ap_info(struct net_device *dev,
	} else
		 return -EINVAL;
	spin_lock_irqsave(&(pmlmepriv->scanned_queue.lock), irqL);
	phead = get_list_head(queue);
	phead = &queue->queue;
	plist = phead->next;
	while (1) {
		if (end_of_queue_search(phead, plist) == true)
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ static u8 do_join(struct _adapter *padapter)
	struct	mlme_priv	*pmlmepriv = &(padapter->mlmepriv);
	struct  __queue	*queue	= &(pmlmepriv->scanned_queue);

	phead = get_list_head(queue);
	phead = &queue->queue;
	plist = phead->next;
	pmlmepriv->cur_network.join_res = -2;
	pmlmepriv->fw_state |= _FW_UNDER_LINKING;
Loading