staging: r8188eu: clean up struct pwrctrl_priv
cover staging: r8188eu: clean up struct pwrctrl_priv
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(-)
Signature · 1 line
2.35.1
PATCH 1/5 staging: r8188eu: remove unused fields from struct pwrctrl_priv
There are some unused fields in the pwrctrl_priv structure. Remove them.
--- drivers/staging/r8188eu/include/rtw_pwrctrl.h | 8 -------- 1 file changed, 8 deletions(-)
drivers/staging/r8188eu/include/rtw_pwrctrl.h +0 -8
@@ -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; };
Signature · 1 line
2.35.1
PATCH 2/5 staging: r8188eu: reg_rfoff is never set
In reply to Michael StraubeThe field reg_rfoff in struct pwrctrl_priv is never set. It stays at its default value 0. Remove it and remove related dead code.
--- drivers/staging/r8188eu/hal/usb_halinit.c | 4 ---- drivers/staging/r8188eu/include/rtw_pwrctrl.h | 2 -- 2 files changed, 6 deletions(-)
drivers/staging/r8188eu/hal/usb_halinit.c +0 -4
@@ -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. */
drivers/staging/r8188eu/include/rtw_pwrctrl.h +0 -2
@@ -49,8 +49,6 @@ struct pwrctrl_priv {bool bpower_saving; -u8 reg_rfoff; -uint ips_enter_cnts;uint ips_leave_cnts;
Signature · 1 line
2.35.1
PATCH 3/5 staging: r8188eu: pnp_bstop_trx is never set
In reply to Michael StraubeThe 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.
--- 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(-)
drivers/staging/r8188eu/hal/usb_ops_linux.c +3 -4
@@ -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)
drivers/staging/r8188eu/include/rtw_pwrctrl.h +0 -1
@@ -64,7 +64,6 @@ struct pwrctrl_priv {u8 power_mgnt;u8 bFwCurrentInPSMode;u32 DelayLPSLastTimeStamp; -u8 pnp_bstop_trx;u8 bInSuspend;u8 bSupportRemoteWakeup;
drivers/staging/r8188eu/os_dep/usb_ops_linux.c +1 -2
@@ -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; }
Signature · 1 line
2.35.1
PATCH 4/5 staging: r8188eu: pwr_state_check_cnts is always zero
In reply to Michael StraubeThe field pwr_state_check_cnts in struct pwrctrl_priv is set to 0 and never changed. Remove it and remove related dead code.
--- 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(-)
drivers/staging/r8188eu/core/rtw_pwrctrl.c +1 -3
@@ -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;
drivers/staging/r8188eu/include/rtw_pwrctrl.h +0 -1
@@ -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;
drivers/staging/r8188eu/os_dep/os_intfs.c +0 -3
@@ -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 ;
Signature · 1 line
2.35.1
PATCH 5/5 staging: r8188eu: ps_flag is never set
In reply to Michael StraubeThe field ps_flag in struct pwrctrl_priv is never set. It stays at its default value 0. Remove it and remove related dead code.
--- drivers/staging/r8188eu/include/rtw_pwrctrl.h | 2 -- drivers/staging/r8188eu/os_dep/os_intfs.c | 7 ------- 2 files changed, 9 deletions(-)
drivers/staging/r8188eu/include/rtw_pwrctrl.h +0 -2
@@ -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;
drivers/staging/r8188eu/os_dep/os_intfs.c +0 -7
@@ -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:
Signature · 1 line
2.35.1