linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vihas Makwana <makvihas@gmail.com>
To: Larry Finger <Larry.Finger@lwfinger.net>,
	Phillip Potter <phil@philpotter.co.uk>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Michael Straube <straube.linux@gmail.com>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Pavel Skripkin <paskripkin@gmail.com>,
	Vihas Makwana <makvihas@gmail.com>
Subject: [PATCH v2 3/7] staging: r8188eu: drop unnecessary wrapper _rtw_init_evt_priv
Date: Mon, 11 Apr 2022 15:51:32 +0530	[thread overview]
Message-ID: <20220411102136.14937-4-makvihas@gmail.com> (raw)
In-Reply-To: <20220411102136.14937-1-makvihas@gmail.com>

Drop unnecessary wrapper _rtw_init_evt_priv and move its logic to
rtw_init_evt_priv.

Signed-off-by: Vihas Makwana <makvihas@gmail.com>
---
 drivers/staging/r8188eu/core/rtw_cmd.c | 27 +++++++++-----------------
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c
index 3d1fdc852..3781706f7 100644
--- a/drivers/staging/r8188eu/core/rtw_cmd.c
+++ b/drivers/staging/r8188eu/core/rtw_cmd.c
@@ -17,22 +17,6 @@
 
 static void c2h_wk_callback(struct work_struct *work);
 
-static int _rtw_init_evt_priv(struct evt_priv *pevtpriv)
-{
-	int res = _SUCCESS;
-
-	/* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */
-	atomic_set(&pevtpriv->event_seq, 0);
-
-	INIT_WORK(&pevtpriv->c2h_wk, c2h_wk_callback);
-	pevtpriv->c2h_wk_alive = false;
-	pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN + 1);
-	if (!pevtpriv->c2h_queue)
-		res = _FAIL;
-
-	return res;
-}
-
 void rtw_free_evt_priv(struct	evt_priv *pevtpriv)
 {
 	cancel_work_sync(&pevtpriv->c2h_wk);
@@ -133,9 +117,16 @@ u32	rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
 
 u32 rtw_init_evt_priv(struct evt_priv *pevtpriv)
 {
-	int	res;
+	u32 res = _SUCCESS;
+
+	/* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */
+	atomic_set(&pevtpriv->event_seq, 0);
 
-	res = _rtw_init_evt_priv(pevtpriv);
+	INIT_WORK(&pevtpriv->c2h_wk, c2h_wk_callback);
+	pevtpriv->c2h_wk_alive = false;
+	pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN + 1);
+	if (!pevtpriv->c2h_queue)
+		res = _FAIL;
 
 	return res;
 }
-- 
2.30.2


  parent reply	other threads:[~2022-04-11 10:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11 10:21 [PATCH v2 0/7] drop some unnecessary wrappers Vihas Makwana
2022-04-11 10:21 ` [PATCH v2 1/7] staging: r8188eu: drop unnecessary wrapper _rtw_free_cmd_priv Vihas Makwana
2022-04-11 10:21 ` [PATCH v2 2/7] staging: r8188eu: drop unnecessary wrapper _rtw_init_cmd_priv Vihas Makwana
2022-04-11 10:21 ` Vihas Makwana [this message]
2022-04-11 10:21 ` [PATCH v2 4/7] staging: r8188eu: drop unnecessary wrapper _rtw_init_mlme_priv Vihas Makwana
2022-04-11 10:21 ` [PATCH v2 5/7] staging: r8188eu: drop unnecessary wrapper _rtw_free_mlme_priv Vihas Makwana
2022-04-11 10:33   ` Dan Carpenter
2022-04-11 10:21 ` [PATCH v2 6/7] staging: r8188eu: drop unnecessary wrapper _rtw_alloc_network Vihas Makwana
2022-04-11 10:21 ` [PATCH v2 7/7] staging: r8188eu: drop unnecessary wrapper _rtw_dequeue_cmd Vihas Makwana
2022-04-11 14:10 ` [PATCH v2 0/7] drop some unnecessary wrappers Dan Carpenter
2022-04-11 20:34 ` Fabio M. De Francesco
2022-04-12  5:06   ` Dan Carpenter
2022-04-12  9:53     ` Fabio M. De Francesco
2022-04-12 15:15       ` Dan Carpenter
2022-04-12 16:08         ` Fabio M. De Francesco
2022-04-13  5:42           ` Dan Carpenter
2022-04-21 18:56             ` Vihas Makwana
2022-04-22  5:53               ` Dan Carpenter
2022-04-22  6:10               ` Greg Kroah-Hartman
2022-04-22  9:21                 ` Fabio M. De Francesco
2022-04-22  9:29                   ` Dan Carpenter
2022-04-22  9:52                     ` Fabio M. De Francesco

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220411102136.14937-4-makvihas@gmail.com \
    --to=makvihas@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=paskripkin@gmail.com \
    --cc=phil@philpotter.co.uk \
    --cc=straube.linux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).