summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kaiser <martin@kaiser.cx>2023-01-23 23:53:30 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-27 12:10:36 +0300
commit8d97399bebe8de645489f5ec941b271ae9fe4d31 (patch)
treeaa18c63759c7f7093e4b046d07d8f0d6ea95192a
parentd5986148e802d1704720202b1e1c94d69c936ebd (diff)
downloadlinux-8d97399bebe8de645489f5ec941b271ae9fe4d31.tar.xz
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: Martin 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.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/r8188eu/core/rtw_xmit.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
index 334d75214011..96079d9a6c42 100644
--- a/drivers/staging/r8188eu/core/rtw_xmit.c
+++ b/drivers/staging/r8188eu/core/rtw_xmit.c
@@ -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;
}