From 92d995d158bb2b5c2cab456f069d8cb06356e1e9 Mon Sep 17 00:00:00 2001 From: Vihas Makwana Date: Sat, 23 Apr 2022 01:02:23 +0530 Subject: [PATCH] staging: r8188eu: drop unnecessary wrapper _rtw_dequeue_cmd Drop unnecessary wrapper _rtw_dequeue_cmd and move its logic to rtw_dequeue_cmd. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220422193223.11948-8-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/r8188eu/core/rtw_cmd.c | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c index 959b69b..06523d9 100644 --- a/drivers/staging/r8188eu/core/rtw_cmd.c +++ b/drivers/staging/r8188eu/core/rtw_cmd.c @@ -56,24 +56,6 @@ exit: return _SUCCESS; } -static struct cmd_obj *_rtw_dequeue_cmd(struct __queue *queue) -{ - struct cmd_obj *obj; - unsigned long flags; - - spin_lock_irqsave(&queue->lock, flags); - if (list_empty(&queue->queue)) { - obj = NULL; - } else { - obj = container_of((&queue->queue)->next, struct cmd_obj, list); - list_del_init(&obj->list); - } - - spin_unlock_irqrestore(&queue->lock, flags); - - return obj; -} - u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) { u32 res = _SUCCESS; @@ -180,11 +162,21 @@ exit: struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv) { - struct cmd_obj *cmd_obj; + struct cmd_obj *obj; + struct __queue *queue = &pcmdpriv->cmd_queue; + unsigned long flags; + + spin_lock_irqsave(&queue->lock, flags); + if (list_empty(&queue->queue)) { + obj = NULL; + } else { + obj = container_of((&queue->queue)->next, struct cmd_obj, list); + list_del_init(&obj->list); + } - cmd_obj = _rtw_dequeue_cmd(&pcmdpriv->cmd_queue); + spin_unlock_irqrestore(&queue->lock, flags); - return cmd_obj; + return obj; } void rtw_free_cmd_obj(struct cmd_obj *pcmd) -- 2.7.4