All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] staging: r8188eu: clean up struct pwrctrl_priv
@ 2022-04-04  8:21 Michael Straube
  2022-04-04  8:21 ` [PATCH 1/5] staging: r8188eu: remove unused fields from " Michael Straube
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Michael Straube @ 2022-04-04  8:21 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel, Michael Straube

Tis series removes unused and set but never changed fields from the
pwrctrl_priv structure.

Tested on x86_64 with Inter-Tech DMG-02.

Michael Straube (5):
  staging: r8188eu: remove unused fields from struct pwrctrl_priv
  staging: r8188eu: reg_rfoff is never set
  staging: r8188eu: pnp_bstop_trx is never set
  staging: r8188eu: pwr_state_check_cnts is always zero
  staging: r8188eu: ps_flag is never set

 drivers/staging/r8188eu/core/rtw_pwrctrl.c     |  4 +---
 drivers/staging/r8188eu/hal/usb_halinit.c      |  4 ----
 drivers/staging/r8188eu/hal/usb_ops_linux.c    |  7 +++----
 drivers/staging/r8188eu/include/rtw_pwrctrl.h  | 14 --------------
 drivers/staging/r8188eu/os_dep/os_intfs.c      | 10 ----------
 drivers/staging/r8188eu/os_dep/usb_ops_linux.c |  3 +--
 6 files changed, 5 insertions(+), 37 deletions(-)

-- 
2.35.1


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

* [PATCH 1/5] staging: r8188eu: remove unused fields from struct pwrctrl_priv
  2022-04-04  8:21 [PATCH 0/5] staging: r8188eu: clean up struct pwrctrl_priv Michael Straube
@ 2022-04-04  8:21 ` Michael Straube
  2022-04-04  8:21 ` [PATCH 2/5] staging: r8188eu: reg_rfoff is never set Michael Straube
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Straube @ 2022-04-04  8:21 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel, Michael Straube

There are some unused fields in the pwrctrl_priv structure.
Remove them.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/r8188eu/include/rtw_pwrctrl.h | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_pwrctrl.h b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
index 4cc365aa3fa7..b0d48106fe56 100644
--- a/drivers/staging/r8188eu/include/rtw_pwrctrl.h
+++ b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
@@ -47,16 +47,10 @@ struct pwrctrl_priv {
 	u8	smart_ps;
 	u8	bcn_ant_mode;
 
-	u32	alives;
-	struct work_struct cpwm_event;
 	bool	bpower_saving;
 
 	u8	reg_rfoff;
-	u8	reg_pdnmode; /* powerdown mode */
 
-	/* RF OFF Level */
-	u32	cur_ps_level;
-	u32	reg_rfps_level;
 	uint	ips_enter_cnts;
 	uint	ips_leave_cnts;
 
@@ -72,7 +66,6 @@ struct pwrctrl_priv {
 	u8	power_mgnt;
 	u8	bFwCurrentInPSMode;
 	u32	DelayLPSLastTimeStamp;
-	s32		pnp_current_pwr_state;
 	u8		pnp_bstop_trx;
 
 	u8		bInSuspend;
@@ -86,7 +79,6 @@ struct pwrctrl_priv {
 	enum rt_rf_power_state	rf_pwrstate;/* cur power state */
 	enum rt_rf_power_state	change_rfpwrstate;
 
-	u8		wepkeymask;
 	u8		bkeepfwalive;
 };
 
-- 
2.35.1


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

* [PATCH 2/5] staging: r8188eu: reg_rfoff is never set
  2022-04-04  8:21 [PATCH 0/5] staging: r8188eu: clean up struct pwrctrl_priv Michael Straube
  2022-04-04  8:21 ` [PATCH 1/5] staging: r8188eu: remove unused fields from " Michael Straube
@ 2022-04-04  8:21 ` Michael Straube
  2022-04-04  8:21 ` [PATCH 3/5] staging: r8188eu: pnp_bstop_trx " Michael Straube
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Straube @ 2022-04-04  8:21 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel, Michael Straube

The field reg_rfoff in struct pwrctrl_priv is never set. It stays at
its default value 0. Remove it and remove related dead code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/r8188eu/hal/usb_halinit.c     | 4 ----
 drivers/staging/r8188eu/include/rtw_pwrctrl.h | 2 --
 2 files changed, 6 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
index 4bc6b08fb282..21ab6881796e 100644
--- a/drivers/staging/r8188eu/hal/usb_halinit.c
+++ b/drivers/staging/r8188eu/hal/usb_halinit.c
@@ -539,10 +539,6 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
 	/*  Save target channel */
 	haldata->CurrentChannel = 6;/* default set to 6 */
 
-	if (pwrctrlpriv->reg_rfoff) {
-		pwrctrlpriv->rf_pwrstate = rf_off;
-	}
-
 	/*  2010/08/09 MH We need to check if we need to turnon or off RF after detecting */
 	/*  HW GPIO pin. Before PHY_RFConfig8192C. */
 	/*  2010/08/26 MH If Efuse does not support sective suspend then disable the function. */
diff --git a/drivers/staging/r8188eu/include/rtw_pwrctrl.h b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
index b0d48106fe56..3efcc65b2f6e 100644
--- a/drivers/staging/r8188eu/include/rtw_pwrctrl.h
+++ b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
@@ -49,8 +49,6 @@ struct pwrctrl_priv {
 
 	bool	bpower_saving;
 
-	u8	reg_rfoff;
-
 	uint	ips_enter_cnts;
 	uint	ips_leave_cnts;
 
-- 
2.35.1


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

* [PATCH 3/5] staging: r8188eu: pnp_bstop_trx is never set
  2022-04-04  8:21 [PATCH 0/5] staging: r8188eu: clean up struct pwrctrl_priv Michael Straube
  2022-04-04  8:21 ` [PATCH 1/5] staging: r8188eu: remove unused fields from " Michael Straube
  2022-04-04  8:21 ` [PATCH 2/5] staging: r8188eu: reg_rfoff is never set Michael Straube
@ 2022-04-04  8:21 ` Michael Straube
  2022-04-04  8:21 ` [PATCH 4/5] staging: r8188eu: pwr_state_check_cnts is always zero Michael Straube
  2022-04-04  8:21 ` [PATCH 5/5] staging: r8188eu: ps_flag is never set Michael Straube
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Straube @ 2022-04-04  8:21 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel, Michael Straube

The field pnp_bstop_trx in struct pwrctrl_priv is never set. It stays
at its default value 0. Remove it and remove related dead code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/r8188eu/hal/usb_ops_linux.c    | 7 +++----
 drivers/staging/r8188eu/include/rtw_pwrctrl.h  | 1 -
 drivers/staging/r8188eu/os_dep/usb_ops_linux.c | 3 +--
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c
index e5d6cd6228f2..6a65dcf57112 100644
--- a/drivers/staging/r8188eu/hal/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c
@@ -16,7 +16,7 @@ static int usb_read(struct intf_hdl *intf, u16 value, void *data, u8 size)
 	int status;
 	u8 io_buf[4];
 
-	if (adapt->bSurpriseRemoved || adapt->pwrctrlpriv.pnp_bstop_trx)
+	if (adapt->bSurpriseRemoved)
 		return -EPERM;
 
 	status = usb_control_msg_recv(udev, 0, REALTEK_USB_VENQT_CMD_REQ,
@@ -59,7 +59,7 @@ static int usb_write(struct intf_hdl *intf, u16 value, void *data, u8 size)
 	int status;
 	u8 io_buf[VENDOR_CMD_MAX_DATA_LEN];
 
-	if (adapt->bSurpriseRemoved || adapt->pwrctrlpriv.pnp_bstop_trx)
+	if (adapt->bSurpriseRemoved)
 		return -EPERM;
 
 	memcpy(io_buf, data, size);
@@ -414,8 +414,7 @@ u32 rtw_read_port(struct adapter *adapter, u8 *rmem)
 	size_t alignment = 0;
 	u32 ret = _SUCCESS;
 
-	if (adapter->bDriverStopped || adapter->bSurpriseRemoved ||
-	    adapter->pwrctrlpriv.pnp_bstop_trx)
+	if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
 		return _FAIL;
 
 	if (!precvbuf)
diff --git a/drivers/staging/r8188eu/include/rtw_pwrctrl.h b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
index 3efcc65b2f6e..94a65056a77e 100644
--- a/drivers/staging/r8188eu/include/rtw_pwrctrl.h
+++ b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
@@ -64,7 +64,6 @@ struct pwrctrl_priv {
 	u8	power_mgnt;
 	u8	bFwCurrentInPSMode;
 	u32	DelayLPSLastTimeStamp;
-	u8		pnp_bstop_trx;
 
 	u8		bInSuspend;
 	u8		bSupportRemoteWakeup;
diff --git a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
index c4b6dbc8d66d..8ca16861bfcc 100644
--- a/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
+++ b/drivers/staging/r8188eu/os_dep/usb_ops_linux.c
@@ -106,8 +106,7 @@ u32 rtw_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem)
 	struct xmit_frame *pxmitframe = (struct xmit_frame *)pxmitbuf->priv_data;
 	struct usb_device *pusbd = pdvobj->pusbdev;
 
-	if ((padapter->bDriverStopped) || (padapter->bSurpriseRemoved) ||
-	    (padapter->pwrctrlpriv.pnp_bstop_trx)) {
+	if (padapter->bDriverStopped || padapter->bSurpriseRemoved) {
 		rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_TX_DENY);
 		goto exit;
 	}
-- 
2.35.1


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

* [PATCH 4/5] staging: r8188eu: pwr_state_check_cnts is always zero
  2022-04-04  8:21 [PATCH 0/5] staging: r8188eu: clean up struct pwrctrl_priv Michael Straube
                   ` (2 preceding siblings ...)
  2022-04-04  8:21 ` [PATCH 3/5] staging: r8188eu: pnp_bstop_trx " Michael Straube
@ 2022-04-04  8:21 ` Michael Straube
  2022-04-04  8:21 ` [PATCH 5/5] staging: r8188eu: ps_flag is never set Michael Straube
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Straube @ 2022-04-04  8:21 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel, Michael Straube

The field pwr_state_check_cnts in struct pwrctrl_priv is set to 0 and
never changed. Remove it and remove related dead code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/r8188eu/core/rtw_pwrctrl.c    | 4 +---
 drivers/staging/r8188eu/include/rtw_pwrctrl.h | 1 -
 drivers/staging/r8188eu/os_dep/os_intfs.c     | 3 ---
 3 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_pwrctrl.c b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
index 5d468e8b4920..939909e5316f 100644
--- a/drivers/staging/r8188eu/core/rtw_pwrctrl.c
+++ b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
@@ -133,9 +133,8 @@ void rtw_ps_processor(struct adapter *padapter)
 	if (!rtw_pwr_unassociated_idle(padapter))
 		goto exit;
 
-	if ((pwrpriv->rf_pwrstate == rf_on) && ((pwrpriv->pwr_state_check_cnts % 4) == 0)) {
+	if (pwrpriv->rf_pwrstate == rf_on) {
 		pwrpriv->change_rfpwrstate = rf_off;
-
 		ips_enter(padapter);
 	}
 exit:
@@ -342,7 +341,6 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter)
 	pwrctrlpriv->ips_mode_req = padapter->registrypriv.ips_mode;
 
 	pwrctrlpriv->pwr_state_check_interval = RTW_PWR_STATE_CHK_INTERVAL;
-	pwrctrlpriv->pwr_state_check_cnts = 0;
 	pwrctrlpriv->bInSuspend = false;
 	pwrctrlpriv->bkeepfwalive = false;
 
diff --git a/drivers/staging/r8188eu/include/rtw_pwrctrl.h b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
index 94a65056a77e..162792988910 100644
--- a/drivers/staging/r8188eu/include/rtw_pwrctrl.h
+++ b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
@@ -69,7 +69,6 @@ struct pwrctrl_priv {
 	u8		bSupportRemoteWakeup;
 	struct timer_list pwr_state_check_timer;
 	int		pwr_state_check_interval;
-	u8		pwr_state_check_cnts;
 
 	int		ps_flag;
 
diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
index c531504acc9e..5a9374957e3a 100644
--- a/drivers/staging/r8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
@@ -441,7 +441,6 @@ static void rtw_init_default_value(struct adapter *padapter)
 u8 rtw_reset_drv_sw(struct adapter *padapter)
 {
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-	struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv;
 
 	/* hal_priv */
 	rtl8188eu_init_default_value(padapter);
@@ -457,8 +456,6 @@ u8 rtw_reset_drv_sw(struct adapter *padapter)
 
 	_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING);
 
-	pwrctrlpriv->pwr_state_check_cnts = 0;
-
 	/* mlmeextpriv */
 	padapter->mlmeextpriv.sitesurvey_res.state = SCAN_DISABLE;
 
-- 
2.35.1


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

* [PATCH 5/5] staging: r8188eu: ps_flag is never set
  2022-04-04  8:21 [PATCH 0/5] staging: r8188eu: clean up struct pwrctrl_priv Michael Straube
                   ` (3 preceding siblings ...)
  2022-04-04  8:21 ` [PATCH 4/5] staging: r8188eu: pwr_state_check_cnts is always zero Michael Straube
@ 2022-04-04  8:21 ` Michael Straube
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Straube @ 2022-04-04  8:21 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel, Michael Straube

The field ps_flag in struct pwrctrl_priv is never set. It stays at its
default value 0. Remove it and remove related dead code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/r8188eu/include/rtw_pwrctrl.h | 2 --
 drivers/staging/r8188eu/os_dep/os_intfs.c     | 7 -------
 2 files changed, 9 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_pwrctrl.h b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
index 162792988910..1d7dba853c40 100644
--- a/drivers/staging/r8188eu/include/rtw_pwrctrl.h
+++ b/drivers/staging/r8188eu/include/rtw_pwrctrl.h
@@ -70,8 +70,6 @@ struct pwrctrl_priv {
 	struct timer_list pwr_state_check_timer;
 	int		pwr_state_check_interval;
 
-	int		ps_flag;
-
 	enum rt_rf_power_state	rf_pwrstate;/* cur power state */
 	enum rt_rf_power_state	change_rfpwrstate;
 
diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c
index 5a9374957e3a..390d1cc0ecb0 100644
--- a/drivers/staging/r8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/r8188eu/os_dep/os_intfs.c
@@ -625,12 +625,6 @@ int _netdev_open(struct net_device *pnetdev)
 {
 	uint status;
 	struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
-	struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv;
-
-	if (pwrctrlpriv->ps_flag) {
-		padapter->net_closed = false;
-		goto netdev_open_normal_process;
-	}
 
 	if (!padapter->bup) {
 		padapter->bDriverStopped = false;
@@ -674,7 +668,6 @@ int _netdev_open(struct net_device *pnetdev)
 
 	netdev_br_init(pnetdev);
 
-netdev_open_normal_process:
 	return 0;
 
 netdev_open_error:
-- 
2.35.1


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

end of thread, other threads:[~2022-04-04  8:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-04  8:21 [PATCH 0/5] staging: r8188eu: clean up struct pwrctrl_priv Michael Straube
2022-04-04  8:21 ` [PATCH 1/5] staging: r8188eu: remove unused fields from " Michael Straube
2022-04-04  8:21 ` [PATCH 2/5] staging: r8188eu: reg_rfoff is never set Michael Straube
2022-04-04  8:21 ` [PATCH 3/5] staging: r8188eu: pnp_bstop_trx " Michael Straube
2022-04-04  8:21 ` [PATCH 4/5] staging: r8188eu: pwr_state_check_cnts is always zero Michael Straube
2022-04-04  8:21 ` [PATCH 5/5] staging: r8188eu: ps_flag is never set Michael Straube

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.