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 <dan.carpenter@oracle.com>
Signed-off-by: Vihas Makwana <makvihas@gmail.com>
Link: https://lore.kernel.org/r/20220422193223.11948-8-makvihas@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Vihas Makwana 2022-04-23 01:02:23 +05:30 committed by Greg Kroah-Hartman
parent 957ab09b8c
commit 92d995d158
1 changed files with 13 additions and 21 deletions

View File

@ -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;
cmd_obj = _rtw_dequeue_cmd(&pcmdpriv->cmd_queue);
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);
}
return cmd_obj;
spin_unlock_irqrestore(&queue->lock, flags);
return obj;
}
void rtw_free_cmd_obj(struct cmd_obj *pcmd)