Commit 8d97399b authored by Martin Kaiser's avatar Martin Kaiser Committed by Greg Kroah-Hartman

staging: r8188eu: simplify dequeue_one_xmitframe

Revert the if condition and exit immediately if the list of xmitframes
is empty. Hopefully, this makes the code a little bit simpler.
Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230123205342.229589-12-martin@kaiser.cxSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d5986148
......@@ -1358,16 +1358,16 @@ s32 rtw_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitfram
static struct xmit_frame *dequeue_one_xmitframe(struct tx_servq *ptxservq, struct __queue *pframe_queue)
{
struct list_head *xmitframe_plist, *xmitframe_phead;
struct xmit_frame *pxmitframe = NULL;
struct xmit_frame *pxmitframe;
xmitframe_phead = get_list_head(pframe_queue);
xmitframe_plist = xmitframe_phead->next;
if (list_empty(xmitframe_phead))
return NULL;
if (!list_empty(xmitframe_phead)) {
pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
list_del_init(&pxmitframe->list);
ptxservq->qcnt--;
}
xmitframe_plist = xmitframe_phead->next;
pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
list_del_init(&pxmitframe->list);
ptxservq->qcnt--;
return pxmitframe;
}
......
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