[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220410163117.3964-5-makvihas@gmail.com>
Date: Sun, 10 Apr 2022 22:01:15 +0530
From: Vihas Makwana <makvihas@...il.com>
To: Larry Finger <Larry.Finger@...inger.net>,
Phillip Potter <phil@...lpotter.co.uk>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Michael Straube <straube.linux@...il.com>
Cc: linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
Dan Carpenter <dan.carpenter@...cle.com>,
Pavel Skripkin <paskripkin@...il.com>,
Vihas Makwana <makvihas@...il.com>
Subject: [PATCH 4/6] staging: r8188eu: drop unnecessary wrapper rtw_dequeue_cmd
Remove the unnecessary wrapper. The logic of rtw_dequeue_cmd can
be moved to _rtw_dequeue_cmd.
Signed-off-by: Vihas Makwana <makvihas@...il.com>
---
drivers/staging/r8188eu/core/rtw_cmd.c | 16 ++++------------
drivers/staging/r8188eu/include/rtw_cmd.h | 2 +-
2 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c
index ac6e710e5..9d1beca43 100644
--- a/drivers/staging/r8188eu/core/rtw_cmd.c
+++ b/drivers/staging/r8188eu/core/rtw_cmd.c
@@ -121,10 +121,11 @@ static int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj)
return _SUCCESS;
}
-static struct cmd_obj *_rtw_dequeue_cmd(struct __queue *queue)
+struct cmd_obj *_rtw_dequeue_cmd(struct cmd_priv *pcmdpriv)
{
struct cmd_obj *obj;
unsigned long flags;
+ struct __queue *queue = &pcmdpriv->cmd_queue;
spin_lock_irqsave(&queue->lock, flags);
if (list_empty(&queue->queue)) {
@@ -178,15 +179,6 @@ u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
return res;
}
-struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv)
-{
- struct cmd_obj *cmd_obj;
-
- cmd_obj = _rtw_dequeue_cmd(&pcmdpriv->cmd_queue);
-
- return cmd_obj;
-}
-
void rtw_free_cmd_obj(struct cmd_obj *pcmd)
{
@@ -230,7 +222,7 @@ int rtw_cmd_thread(void *context)
padapter->bSurpriseRemoved)
break;
- pcmd = rtw_dequeue_cmd(pcmdpriv);
+ pcmd = _rtw_dequeue_cmd(pcmdpriv);
if (!pcmd)
continue;
@@ -280,7 +272,7 @@ int rtw_cmd_thread(void *context)
/* free all cmd_obj resources */
do {
- pcmd = rtw_dequeue_cmd(pcmdpriv);
+ pcmd = _rtw_dequeue_cmd(pcmdpriv);
if (!pcmd)
break;
diff --git a/drivers/staging/r8188eu/include/rtw_cmd.h b/drivers/staging/r8188eu/include/rtw_cmd.h
index 7edce0f88..d581deebb 100644
--- a/drivers/staging/r8188eu/include/rtw_cmd.h
+++ b/drivers/staging/r8188eu/include/rtw_cmd.h
@@ -77,7 +77,7 @@ struct c2h_evt_hdr {
#define c2h_evt_exist(c2h_evt) ((c2h_evt)->id || (c2h_evt)->plen)
u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *obj);
-struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv);
+struct cmd_obj *_rtw_dequeue_cmd(struct cmd_priv *pcmdpriv);
void rtw_free_cmd_obj(struct cmd_obj *pcmd);
int rtw_cmd_thread(void *context);
--
2.30.2
Powered by blists - more mailing lists