linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] staging: rtl8188eu: make rtw_android_cmdstr_to_num static
@ 2021-05-05 20:26 Martin Kaiser
  2021-05-05 20:26 ` [PATCH 2/6] staging: rtl8188eu: rtw_init_cmd_priv never fails Martin Kaiser
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Martin Kaiser @ 2021-05-05 20:26 UTC (permalink / raw)
  To: Larry Finger, Greg Kroah-Hartman
  Cc: linux-staging, kernel-janitors, linux-kernel, Martin Kaiser

This function is used only in rtw_android.c.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/rtl8188eu/include/rtw_android.h | 1 -
 drivers/staging/rtl8188eu/os_dep/rtw_android.c  | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_android.h b/drivers/staging/rtl8188eu/include/rtw_android.h
index d7ca7c2fb118..2c26993b8205 100644
--- a/drivers/staging/rtl8188eu/include/rtw_android.h
+++ b/drivers/staging/rtl8188eu/include/rtw_android.h
@@ -45,7 +45,6 @@ enum ANDROID_WIFI_CMD {
 	ANDROID_WIFI_CMD_MAX
 };
 
-int rtw_android_cmdstr_to_num(char *cmdstr);
 int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd);
 
 #endif /* __RTW_ANDROID_H__ */
diff --git a/drivers/staging/rtl8188eu/os_dep/rtw_android.c b/drivers/staging/rtl8188eu/os_dep/rtw_android.c
index f1470ac56874..99475be30702 100644
--- a/drivers/staging/rtl8188eu/os_dep/rtw_android.c
+++ b/drivers/staging/rtl8188eu/os_dep/rtw_android.c
@@ -52,7 +52,7 @@ struct android_wifi_priv_cmd {
 	int total_len;
 };
 
-int rtw_android_cmdstr_to_num(char *cmdstr)
+static int rtw_android_cmdstr_to_num(char *cmdstr)
 {
 	int cmd_num;
 
-- 
2.20.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/6] staging: rtl8188eu: rtw_init_cmd_priv never fails
  2021-05-05 20:26 [PATCH 1/6] staging: rtl8188eu: make rtw_android_cmdstr_to_num static Martin Kaiser
@ 2021-05-05 20:26 ` Martin Kaiser
  2021-05-05 20:26 ` [PATCH 3/6] staging: rtl8188eu: don't block until cmdthread runs Martin Kaiser
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Martin Kaiser @ 2021-05-05 20:26 UTC (permalink / raw)
  To: Larry Finger, Greg Kroah-Hartman
  Cc: linux-staging, kernel-janitors, linux-kernel, Martin Kaiser

Change the return type to void. Remove unnecessary error handling.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/rtl8188eu/core/rtw_cmd.c    | 3 +--
 drivers/staging/rtl8188eu/include/rtw_cmd.h | 2 +-
 drivers/staging/rtl8188eu/os_dep/os_intfs.c | 6 +-----
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index 6728391d39e3..61d0342c76fc 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -52,13 +52,12 @@ static struct _cmd_callback rtw_cmd_callback[] = {
  * No irqsave is necessary.
  */
 
-int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
+void rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
 {
 	init_completion(&pcmdpriv->cmd_queue_comp);
 	init_completion(&pcmdpriv->terminate_cmdthread_comp);
 
 	_rtw_init_queue(&pcmdpriv->cmd_queue);
-	return _SUCCESS;
 }
 
 /*
diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h
index 68b8ad1a412f..cb0eb4a1d2b7 100644
--- a/drivers/staging/rtl8188eu/include/rtw_cmd.h
+++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h
@@ -54,7 +54,7 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd);
 
 int rtw_cmd_thread(void *context);
 
-int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv);
+void rtw_init_cmd_priv(struct cmd_priv *pcmdpriv);
 
 enum rtw_drvextra_cmd_id {
 	NONE_WK_CID,
diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
index a826228cbbe9..55ed721994a0 100644
--- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
@@ -424,11 +424,7 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
 
 	RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+%s\n", __func__));
 
-	if ((rtw_init_cmd_priv(&padapter->cmdpriv)) == _FAIL) {
-		RT_TRACE(_module_os_intfs_c_, _drv_err_, ("\n Can't init cmd_priv\n"));
-		ret8 = _FAIL;
-		goto exit;
-	}
+	rtw_init_cmd_priv(&padapter->cmdpriv);
 
 	padapter->cmdpriv.padapter = padapter;
 
-- 
2.20.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 3/6] staging: rtl8188eu: don't block until cmdthread runs
  2021-05-05 20:26 [PATCH 1/6] staging: rtl8188eu: make rtw_android_cmdstr_to_num static Martin Kaiser
  2021-05-05 20:26 ` [PATCH 2/6] staging: rtl8188eu: rtw_init_cmd_priv never fails Martin Kaiser
@ 2021-05-05 20:26 ` Martin Kaiser
  2021-05-05 20:26 ` [PATCH 4/6] staging: rtl8188eu: remove padapter from struct cmd_priv Martin Kaiser
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Martin Kaiser @ 2021-05-05 20:26 UTC (permalink / raw)
  To: Larry Finger, Greg Kroah-Hartman
  Cc: linux-staging, kernel-janitors, linux-kernel, Martin Kaiser

rtw_start_drv_threads starts a cmdthread that runs in a loop. It
reads a command from a queue and processes it. There's no need for
any synchronization when this thread is started.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/rtl8188eu/core/rtw_cmd.c    | 1 -
 drivers/staging/rtl8188eu/os_dep/os_intfs.c | 3 ---
 2 files changed, 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index 61d0342c76fc..955899f334e6 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -181,7 +181,6 @@ int rtw_cmd_thread(void *context)
 	allow_signal(SIGTERM);
 
 	pcmdpriv->cmdthd_running = true;
-	complete(&pcmdpriv->terminate_cmdthread_comp);
 
 	RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_,
 		 ("start r871x %s !!!!\n", __func__));
diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
index 55ed721994a0..193895338cf0 100644
--- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
@@ -330,9 +330,6 @@ static int rtw_start_drv_threads(struct adapter *padapter)
 					  "RTW_CMD_THREAD");
 	if (IS_ERR(padapter->cmdThread))
 		err = PTR_ERR(padapter->cmdThread);
-	else
-		/* wait for cmd_thread to run */
-		wait_for_completion_interruptible(&padapter->cmdpriv.terminate_cmdthread_comp);
 
 	return err;
 }
-- 
2.20.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 4/6] staging: rtl8188eu: remove padapter from struct cmd_priv
  2021-05-05 20:26 [PATCH 1/6] staging: rtl8188eu: make rtw_android_cmdstr_to_num static Martin Kaiser
  2021-05-05 20:26 ` [PATCH 2/6] staging: rtl8188eu: rtw_init_cmd_priv never fails Martin Kaiser
  2021-05-05 20:26 ` [PATCH 3/6] staging: rtl8188eu: don't block until cmdthread runs Martin Kaiser
@ 2021-05-05 20:26 ` Martin Kaiser
  2021-05-05 20:26 ` [PATCH 5/6] staging: rtl8188eu: remove nic_hdl from struct mlme_priv Martin Kaiser
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Martin Kaiser @ 2021-05-05 20:26 UTC (permalink / raw)
  To: Larry Finger, Greg Kroah-Hartman
  Cc: linux-staging, kernel-janitors, linux-kernel, Martin Kaiser

struct cmd_priv is an element of struct adapter. Use container_of
to get a pointer to the enclosing struct.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/rtl8188eu/core/rtw_cmd.c    | 9 +++++----
 drivers/staging/rtl8188eu/include/rtw_cmd.h | 1 -
 drivers/staging/rtl8188eu/os_dep/os_intfs.c | 2 --
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index 955899f334e6..64e83684fb81 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -103,11 +103,12 @@ struct cmd_obj *rtw_dequeue_cmd(struct __queue *queue)
 
 static int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
 {
+	struct adapter *padapter = container_of(pcmdpriv, struct adapter, cmdpriv);
 	u8 bAllow = false; /* set to true to allow enqueuing cmd when hw_init_completed is false */
 
 	/* To decide allow or not */
-	if ((pcmdpriv->padapter->pwrctrlpriv.bHWPwrPindetect) &&
-	    (!pcmdpriv->padapter->registrypriv.usbss_enable)) {
+	if ((padapter->pwrctrlpriv.bHWPwrPindetect) &&
+	    (!padapter->registrypriv.usbss_enable)) {
 		if (cmd_obj->cmdcode == _Set_Drv_Extra_CMD_) {
 			struct drvextra_cmd_parm	*pdrvextra_cmd_parm = (struct drvextra_cmd_parm	*)cmd_obj->parmbuf;
 
@@ -119,7 +120,7 @@ static int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
 	if (cmd_obj->cmdcode == _SetChannelPlan_CMD_)
 		bAllow = true;
 
-	if ((!pcmdpriv->padapter->hw_init_completed && !bAllow) ||
+	if ((!padapter->hw_init_completed && !bAllow) ||
 	    !pcmdpriv->cmdthd_running)	/* com_thread not running */
 		return _FAIL;
 	return _SUCCESS;
@@ -128,7 +129,7 @@ static int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
 u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
 {
 	int res = _FAIL;
-	struct adapter *padapter = pcmdpriv->padapter;
+	struct adapter *padapter = container_of(pcmdpriv, struct adapter, cmdpriv);
 
 	if (!cmd_obj)
 		goto exit;
diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h b/drivers/staging/rtl8188eu/include/rtw_cmd.h
index cb0eb4a1d2b7..0261cd931c35 100644
--- a/drivers/staging/rtl8188eu/include/rtw_cmd.h
+++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h
@@ -35,7 +35,6 @@ struct cmd_priv {
 	struct completion terminate_cmdthread_comp;
 	struct __queue cmd_queue;
 	u8 cmdthd_running;
-	struct adapter *padapter;
 };
 
 #define init_h2fwcmd_w_parm_no_rsp(pcmd, pparm, code) \
diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
index 193895338cf0..5207cb0c60cd 100644
--- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
@@ -423,8 +423,6 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
 
 	rtw_init_cmd_priv(&padapter->cmdpriv);
 
-	padapter->cmdpriv.padapter = padapter;
-
 	if (rtw_init_mlme_priv(padapter) == _FAIL) {
 		RT_TRACE(_module_os_intfs_c_, _drv_err_, ("\n Can't init mlme_priv\n"));
 		ret8 = _FAIL;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 5/6] staging: rtl8188eu: remove nic_hdl from struct mlme_priv
  2021-05-05 20:26 [PATCH 1/6] staging: rtl8188eu: make rtw_android_cmdstr_to_num static Martin Kaiser
                   ` (2 preceding siblings ...)
  2021-05-05 20:26 ` [PATCH 4/6] staging: rtl8188eu: remove padapter from struct cmd_priv Martin Kaiser
@ 2021-05-05 20:26 ` Martin Kaiser
  2021-05-06 10:14   ` Greg Kroah-Hartman
  2021-05-05 20:26 ` [PATCH 6/6] staging: rtl8188eu: remove padapter from struct mlme_ext_priv Martin Kaiser
  2021-05-06 12:14 ` [PATCH v2] staging: rtl8188eu: remove nic_hdl from struct mlme_priv Martin Kaiser
  5 siblings, 1 reply; 8+ messages in thread
From: Martin Kaiser @ 2021-05-05 20:26 UTC (permalink / raw)
  To: Larry Finger, Greg Kroah-Hartman
  Cc: linux-staging, kernel-janitors, linux-kernel, Martin Kaiser

struct mlme_priv is an element of struct adapter. Use container_of
to get a pointer to the enclosing struct.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/rtl8188eu/core/rtw_mlme.c    | 5 +----
 drivers/staging/rtl8188eu/include/rtw_mlme.h | 2 --
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c
index b6ac5b8915b1..e19091a2a4b8 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
@@ -32,8 +32,6 @@ int rtw_init_mlme_priv(struct adapter *padapter)
 
 	/*  We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
 
-	pmlmepriv->nic_hdl = (u8 *)padapter;
-
 	pmlmepriv->pscanned = NULL;
 	pmlmepriv->fw_state = 0;
 	pmlmepriv->cur_network.network.InfrastructureMode = Ndis802_11AutoUnknown;
@@ -1456,7 +1454,7 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
 {
 	int ret;
 	struct list_head *phead;
-	struct adapter *adapter;
+	struct adapter *adapter = container_of(pmlmepriv, struct adapter, mlmepriv);
 	struct __queue *queue = &pmlmepriv->scanned_queue;
 	struct wlan_network *pnetwork = NULL;
 	struct wlan_network *candidate = NULL;
@@ -1464,7 +1462,6 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
 
 	spin_lock_bh(&pmlmepriv->scanned_queue.lock);
 	phead = get_list_head(queue);
-	adapter = (struct adapter *)pmlmepriv->nic_hdl;
 	pmlmepriv->pscanned = phead->next;
 	while (phead != pmlmepriv->pscanned) {
 		pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h
index 1b74b32b8a81..f5e805c13442 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h
@@ -111,8 +111,6 @@ struct mlme_priv {
 	u8 to_join; /* flag */
 	u8 to_roaming; /*  roaming trying times */
 
-	u8 *nic_hdl;
-
 	struct list_head *pscanned;
 	struct __queue free_bss_pool;
 	struct __queue scanned_queue;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 6/6] staging: rtl8188eu: remove padapter from struct mlme_ext_priv
  2021-05-05 20:26 [PATCH 1/6] staging: rtl8188eu: make rtw_android_cmdstr_to_num static Martin Kaiser
                   ` (3 preceding siblings ...)
  2021-05-05 20:26 ` [PATCH 5/6] staging: rtl8188eu: remove nic_hdl from struct mlme_priv Martin Kaiser
@ 2021-05-05 20:26 ` Martin Kaiser
  2021-05-06 12:14 ` [PATCH v2] staging: rtl8188eu: remove nic_hdl from struct mlme_priv Martin Kaiser
  5 siblings, 0 replies; 8+ messages in thread
From: Martin Kaiser @ 2021-05-05 20:26 UTC (permalink / raw)
  To: Larry Finger, Greg Kroah-Hartman
  Cc: linux-staging, kernel-janitors, linux-kernel, Martin Kaiser

struct mlme_ext_priv is an element of struct adapter. Use container_of
to get a pointer to the enclosing struct.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c    | 4 +---
 drivers/staging/rtl8188eu/include/rtw_mlme_ext.h | 1 -
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 50d3c3631be0..25118ca08562 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -4017,8 +4017,6 @@ int init_mlme_ext_priv(struct adapter *padapter)
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 	struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
 
-	pmlmeext->padapter = padapter;
-
 	init_mlme_ext_priv_value(padapter);
 	pmlmeinfo->accept_addba_req = pregistrypriv->accept_addba_req;
 
@@ -4041,7 +4039,7 @@ int init_mlme_ext_priv(struct adapter *padapter)
 
 void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext)
 {
-	struct adapter *padapter = pmlmeext->padapter;
+	struct adapter *padapter = container_of(pmlmeext, struct adapter, mlmeextpriv);
 
 	if (!padapter)
 		return;
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
index 03d55eb7dc16..fcf366f9be90 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
@@ -383,7 +383,6 @@ struct p2p_oper_class_map {
 };
 
 struct mlme_ext_priv {
-	struct adapter	*padapter;
 	u8	mlmeext_init;
 	atomic_t	event_seq;
 	u16	mgnt_seq;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 5/6] staging: rtl8188eu: remove nic_hdl from struct mlme_priv
  2021-05-05 20:26 ` [PATCH 5/6] staging: rtl8188eu: remove nic_hdl from struct mlme_priv Martin Kaiser
@ 2021-05-06 10:14   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2021-05-06 10:14 UTC (permalink / raw)
  To: Martin Kaiser; +Cc: Larry Finger, linux-staging, kernel-janitors, linux-kernel

On Wed, May 05, 2021 at 10:26:21PM +0200, Martin Kaiser wrote:
> struct mlme_priv is an element of struct adapter. Use container_of
> to get a pointer to the enclosing struct.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
>  drivers/staging/rtl8188eu/core/rtw_mlme.c    | 5 +----
>  drivers/staging/rtl8188eu/include/rtw_mlme.h | 2 --
>  2 files changed, 1 insertion(+), 6 deletions(-)

This patch didn't apply to my tree, can you rebase and resend just this
one as I've taken your others?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] staging: rtl8188eu: remove nic_hdl from struct mlme_priv
  2021-05-05 20:26 [PATCH 1/6] staging: rtl8188eu: make rtw_android_cmdstr_to_num static Martin Kaiser
                   ` (4 preceding siblings ...)
  2021-05-05 20:26 ` [PATCH 6/6] staging: rtl8188eu: remove padapter from struct mlme_ext_priv Martin Kaiser
@ 2021-05-06 12:14 ` Martin Kaiser
  5 siblings, 0 replies; 8+ messages in thread
From: Martin Kaiser @ 2021-05-06 12:14 UTC (permalink / raw)
  To: Larry Finger, Greg Kroah-Hartman
  Cc: linux-staging, kernel-janitors, linux-kernel, Martin Kaiser

struct mlme_priv is an element of struct adapter. Use container_of
to get a pointer to the enclosing struct.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
v2:
 - rebased against current staging-testing branch

 drivers/staging/rtl8188eu/core/rtw_mlme.c    | 5 +----
 drivers/staging/rtl8188eu/include/rtw_mlme.h | 2 --
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c
index 049e25455849..159465b073c2 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
@@ -32,8 +32,6 @@ int rtw_init_mlme_priv(struct adapter *padapter)
 
 	/*  We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
 
-	pmlmepriv->nic_hdl = (u8 *)padapter;
-
 	pmlmepriv->pscanned = NULL;
 	pmlmepriv->fw_state = 0;
 	pmlmepriv->cur_network.network.InfrastructureMode = Ndis802_11AutoUnknown;
@@ -1446,7 +1444,7 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
 {
 	int ret;
 	struct list_head *phead;
-	struct adapter *adapter;
+	struct adapter *adapter = container_of(pmlmepriv, struct adapter, mlmepriv);
 	struct __queue *queue = &pmlmepriv->scanned_queue;
 	struct wlan_network *pnetwork = NULL;
 	struct wlan_network *candidate = NULL;
@@ -1454,7 +1452,6 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
 
 	spin_lock_bh(&pmlmepriv->scanned_queue.lock);
 	phead = get_list_head(queue);
-	adapter = (struct adapter *)pmlmepriv->nic_hdl;
 	list_for_each(pmlmepriv->pscanned, phead) {
 		pnetwork = list_entry(pmlmepriv->pscanned,
 				      struct wlan_network, list);
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h b/drivers/staging/rtl8188eu/include/rtw_mlme.h
index 1b74b32b8a81..f5e805c13442 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h
@@ -111,8 +111,6 @@ struct mlme_priv {
 	u8 to_join; /* flag */
 	u8 to_roaming; /*  roaming trying times */
 
-	u8 *nic_hdl;
-
 	struct list_head *pscanned;
 	struct __queue free_bss_pool;
 	struct __queue scanned_queue;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-05-06 12:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-05 20:26 [PATCH 1/6] staging: rtl8188eu: make rtw_android_cmdstr_to_num static Martin Kaiser
2021-05-05 20:26 ` [PATCH 2/6] staging: rtl8188eu: rtw_init_cmd_priv never fails Martin Kaiser
2021-05-05 20:26 ` [PATCH 3/6] staging: rtl8188eu: don't block until cmdthread runs Martin Kaiser
2021-05-05 20:26 ` [PATCH 4/6] staging: rtl8188eu: remove padapter from struct cmd_priv Martin Kaiser
2021-05-05 20:26 ` [PATCH 5/6] staging: rtl8188eu: remove nic_hdl from struct mlme_priv Martin Kaiser
2021-05-06 10:14   ` Greg Kroah-Hartman
2021-05-05 20:26 ` [PATCH 6/6] staging: rtl8188eu: remove padapter from struct mlme_ext_priv Martin Kaiser
2021-05-06 12:14 ` [PATCH v2] staging: rtl8188eu: remove nic_hdl from struct mlme_priv Martin Kaiser

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).