[PATCH v2 1/7] staging: r8188eu: drop unnecessary wrapper _rtw_free_cmd_priv

From: Vihas Makwana
Date: Mon Apr 11 2022 - 06:23:28 EST


Drop unnecessary wrapper _rtw_free_cmd_priv and move its logic to
rtw_free_cmd_priv.

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

diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c
index f036a980e..d53217900 100644
--- a/drivers/staging/r8188eu/core/rtw_cmd.c
+++ b/drivers/staging/r8188eu/core/rtw_cmd.c
@@ -87,14 +87,6 @@ void rtw_free_evt_priv(struct evt_priv *pevtpriv)
}
}

-static void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)
-{
- if (pcmdpriv) {
- kfree(pcmdpriv->cmd_allocated_buf);
- kfree(pcmdpriv->rsp_allocated_buf);
- }
-}
-
/* Calling Context:
*
* rtw_enqueue_cmd can only be called between kernel thread,
@@ -159,7 +151,10 @@ u32 rtw_init_evt_priv(struct evt_priv *pevtpriv)

void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)
{
- _rtw_free_cmd_priv(pcmdpriv);
+ if (pcmdpriv) {
+ kfree(pcmdpriv->cmd_allocated_buf);
+ kfree(pcmdpriv->rsp_allocated_buf);
+ }
}

static int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
--
2.30.2