staging: rtl8188eu: Remove unnecessary functions
v2 cover staging: rtl8188eu: Remove unnecessary functions
This patchset removes unnecessary functions that aren't used, or can be replaced by a single line of code.
Changes in v2:
-Renamed function appropriately
Amitoj Kaur Chawla(3):
staging: rtl8188eu: core: rtw_ap : Remove unnecessary functions
staging: rtl8188eu: Remove unused function
staging: rtl8188eu: core: Remove wrapper function
drivers/staging/rtl8188eu/core/rtw_ap.c | 54 +-------------------------- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 41 +++++++++++--------- drivers/staging/rtl8188eu/core/rtw_xmit.c | 5 --- drivers/staging/rtl8188eu/include/rtw_xmit.h | 1 - 4 files changed, 25 insertions(+), 76 deletions(-)
Signature · 1 line
1.9.1
PATCH v2 1/3 staging: rtl8188eu: core: rtw_ap : Remove unnecessary functions
Drop unnecessary functions that are declared but not being used.
---
Changes in v2:
-None
drivers/staging/rtl8188eu/core/rtw_ap.c | 54 +-------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-)
drivers/staging/rtl8188eu/core/rtw_ap.c +1 -53
@@ -1240,11 +1240,6 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)return 0 ; } -static void update_bcn_fixed_ie (struct adapter *padapter) -{ -DBG_88E ("%s\n" , __func__); -} -static void update_bcn_erpinfo_ie (struct adapter *padapter) {struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
@@ -1279,31 +1274,6 @@ static void update_bcn_erpinfo_ie(struct adapter *padapter) } } -static void update_bcn_htcap_ie (struct adapter *padapter) -{ -DBG_88E ("%s\n" , __func__); -} - -static void update_bcn_htinfo_ie (struct adapter *padapter) -{ -DBG_88E ("%s\n" , __func__); -} - -static void update_bcn_rsn_ie (struct adapter *padapter) -{ -DBG_88E ("%s\n" , __func__); -} - -static void update_bcn_wpa_ie (struct adapter *padapter) -{ -DBG_88E ("%s\n" , __func__); -} - -static void update_bcn_wmm_ie (struct adapter *padapter) -{ -DBG_88E ("%s\n" , __func__); -} -static void update_bcn_wps_ie (struct adapter *padapter) {u8 *pwps_ie =NULL , *pwps_ie_src;
@@ -1354,22 +1324,12 @@ static void update_bcn_wps_ie(struct adapter *padapter)kfree (pbackup_remainder_ie); } -static void update_bcn_p2p_ie (struct adapter *padapter) -{ -} -static void update_bcn_vendor_spec_ie (struct adapter *padapter,u8 *oui) {DBG_88E ("%s\n" , __func__); -if (!memcmp (RTW_WPA_OUI , oui,4 )) -update_bcn_wpa_ie (padapter); -else if (!memcmp (WMM_OUI , oui,4 )) -update_bcn_wmm_ie (padapter); -else if (!memcmp (WPS_OUI , oui,4 )) +if (!memcmp (WPS_OUI , oui,4 ))update_bcn_wps_ie (padapter); -else if (!memcmp (P2P_OUI , oui,4 )) -update_bcn_p2p_ie (padapter);else DBG_88E ("unknown OUI type!\n" ); }
@@ -1391,24 +1351,12 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx)spin_lock_bh (&pmlmepriv->bcn_update_lock);switch (ie_id) { -case 0xFF : -update_bcn_fixed_ie (padapter);/* 8: TimeStamp, 2: Beacon Interval 2:Capability */ -break ;case _TIM_IE_:update_BCNTIM (padapter);break ;case _ERPINFO_IE_:update_bcn_erpinfo_ie (padapter);break ; -case _HT_CAPABILITY_IE_: -update_bcn_htcap_ie (padapter); -break ; -case _RSN_IE_2_: -update_bcn_rsn_ie (padapter); -break ; -case _HT_ADD_INFO_IE_: -update_bcn_htinfo_ie (padapter); -break ;case _VENDOR_SPECIFIC_IE_:update_bcn_vendor_spec_ie (padapter, oui);break ;
Signature · 1 line
1.9.1
PATCH v2 2/3 staging: rtl8188eu: Remove unused function
In reply to Amitoj Kaur ChawlaRemove function that is declared but not called anywhere.
---
Changes in v2:
-None
drivers/staging/rtl8188eu/core/rtw_xmit.c | 5 ----- drivers/staging/rtl8188eu/include/rtw_xmit.h | 1 - 2 files changed, 6 deletions(-)
drivers/staging/rtl8188eu/core/rtw_xmit.c +0 -5
@@ -2186,11 +2186,6 @@ void rtw_sctx_done_err(struct submit_ctx **sctx, int status) } } -void rtw_sctx_done (struct submit_ctx **sctx) -{ -rtw_sctx_done_err (sctx,RTW_SCTX_DONE_SUCCESS ); -} -int rtw_ack_tx_wait (struct xmit_priv *pxmitpriv,u32 timeout_ms) {struct submit_ctx *pack_tx_ops = &pxmitpriv->ack_tx_ops;
drivers/staging/rtl8188eu/include/rtw_xmit.h +0 -1
@@ -197,7 +197,6 @@ enum {void rtw_sctx_init (struct submit_ctx *sctx,int timeout_ms);int rtw_sctx_wait (struct submit_ctx *sctx);void rtw_sctx_done_err (struct submit_ctx **sctx,int status); -void rtw_sctx_done (struct submit_ctx **sctx);struct xmit_buf {struct list_head list;
Signature · 1 line
1.9.1
PATCH v2 3/3 staging: rtl8188eu: core: Remove wrapper function
In reply to Amitoj Kaur ChawlaRemove wrapper function issue_probereq() that can be replaced by a single line of code and rename _issue_probereq() to issue_probereq().
This patch also fixes line over 80 characters checkpatch.pl warning.
---
Changes in v2:
-Renamed _issue_probereq() to issue_probereq()
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 41 ++++++++++++++++----------- 1 file changed, 24 insertions(+), 17 deletions(-)
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +24 -17
@@ -608,7 +608,7 @@ static void issue_probersp(struct adapter *padapter, unsigned char *da)return ; } -static int _issue_probereq (struct adapter *padapter,struct ndis_802_11_ssid *pssid,u8 *da,int wait_ack) +static int issue_probereq (struct adapter *padapter,struct ndis_802_11_ssid *pssid,u8 *da,int wait_ack) {int ret = _FAIL;struct xmit_frame *pmgntframe;
@@ -701,12 +701,6 @@ exit:return ret; } -static inline void issue_probereq (struct adapter *padapter, -struct ndis_802_11_ssid *pssid,u8 *da) -{ -_issue_probereq (padapter, pssid, da, false); -} -static int issue_probereq_ex (struct adapter *padapter,struct ndis_802_11_ssid *pssid,u8 *da,int try_cnt,int wait_ms)
@@ -716,7 +710,7 @@ static int issue_probereq_ex(struct adapter *padapter,u32 start = jiffies; do { - ret = _issue_probereq(padapter, pssid, da, wait_ms > 0 ? true : false); + ret = issue_probereq(padapter, pssid, da, wait_ms > 0 ? true : false); i++;
@@ -2029,24 +2023,28 @@ static void site_survey(struct adapter *padapter)for (i =0 ; i <RTW_SSID_SCAN_AMOUNT ; i++) {if (pmlmeext->sitesurvey_res.ssid[i].SsidLength) {/* todo: to issue two probe req??? */ -issue_probereq (padapter, &(pmlmeext->sitesurvey_res.ssid[i]),NULL ); +issue_probereq (padapter, + &(pmlmeext->sitesurvey_res.ssid[i]), +NULL , false);/* msleep(SURVEY_TO>>1); */ -issue_probereq (padapter, &(pmlmeext->sitesurvey_res.ssid[i]),NULL ); +issue_probereq (padapter, + &(pmlmeext->sitesurvey_res.ssid[i]), +NULL , false); } }if (pmlmeext->sitesurvey_res.scan_mode ==SCAN_ACTIVE ) {/* todo: to issue two probe req??? */ -issue_probereq (padapter,NULL ,NULL ); +issue_probereq (padapter,NULL ,NULL , false);/* msleep(SURVEY_TO>>1); */ -issue_probereq (padapter,NULL ,NULL ); +issue_probereq (padapter,NULL ,NULL , false); }if (pmlmeext->sitesurvey_res.scan_mode ==SCAN_ACTIVE ) {/* todo: to issue two probe req??? */ -issue_probereq (padapter,NULL ,NULL ); +issue_probereq (padapter,NULL ,NULL , false);/* msleep(SURVEY_TO>>1); */ -issue_probereq (padapter,NULL ,NULL ); +issue_probereq (padapter,NULL ,NULL , false); } }
@@ -4820,9 +4818,18 @@ void linked_status_chk(struct adapter *padapter) }else {if (rx_chk != _SUCCESS) {if (pmlmeext->retry ==0 ) { -issue_probereq (padapter, &pmlmeinfo->network.Ssid, pmlmeinfo->network.MacAddress); -issue_probereq (padapter, &pmlmeinfo->network.Ssid, pmlmeinfo->network.MacAddress); -issue_probereq (padapter, &pmlmeinfo->network.Ssid, pmlmeinfo->network.MacAddress); +issue_probereq (padapter, + &pmlmeinfo->network.Ssid, + pmlmeinfo->network.MacAddress, + false); +issue_probereq (padapter, + &pmlmeinfo->network.Ssid, + pmlmeinfo->network.MacAddress, + false); +issue_probereq (padapter, + &pmlmeinfo->network.Ssid, + pmlmeinfo->network.MacAddress, + false); } }
Signature · 1 line
1.9.1
Re: [Outreachy kernel] [PATCH v2 3/3] staging: rtl8188eu: core: Remove wrapper function
Quoted 18 lines · Amitoj Kaur Chawla
Remove wrapper function
issue_probereq()that can be replaced by a single line of code and rename_issue_probereq()toissue_probereq().This patch also fixes line over 80 characters checkpatch.pl warning.
Signed-off-by Amitoj Kaur Chawla <[email protected]>---
Changes in v2:
-Renamed_issue_probereq()toissue_probereq()drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 41 ++++++++++++++++----------- 1 file changed, 24 insertions(+), 17 deletions(-)drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +0
-0
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c static void issue_probersp(struct adapter *padapter, unsigned char *da) · line 611
Quoted 5 lines
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +1
-1@@ -608,7 +608,7 @@ static void issue_probersp(struct adapter *padapter, unsigned char *da)return ; } -static int _issue_probereq (struct adapter *padapter,struct ndis_802_11_ssid *pssid,u8 *da,int wait_ack) +static int issue_probereq (struct adapter *padapter,struct ndis_802_11_ssid *pssid,u8 *da,int wait_ack)
Not related to your patch. But maybe in a later patch you can change int wait_ack to bool wait_ack, as it is only taking true and false as its argument.
regards
sudip
Re: [Outreachy kernel] [PATCH v2 3/3] staging: rtl8188eu: core: Remove wrapper function
Quoted 29 lines · Sudip Mukherjee
Quoted 18 lines · Amitoj Kaur Chawla
Remove wrapper function
issue_probereq()that can be replaced by a single line of code and rename_issue_probereq()toissue_probereq().This patch also fixes line over 80 characters checkpatch.pl warning.
Signed-off-by Amitoj Kaur Chawla <[email protected]>---
Changes in v2:
-Renamed_issue_probereq()toissue_probereq()drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 41 ++++++++++++++++----------- 1 file changed, 24 insertions(+), 17 deletions(-)drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +0
-0drivers/staging/rtl8188eu/core/rtw_mlme_ext.c static void issue_probersp(struct adapter *padapter, unsigned char *da) · line 611
Quoted 5 lines
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +1
-1@@ -608,7 +608,7 @@ static void issue_probersp(struct adapter *padapter, unsigned char *da)return ; } -static int _issue_probereq (struct adapter *padapter,struct ndis_802_11_ssid *pssid,u8 *da,int wait_ack) +static int issue_probereq (struct adapter *padapter,struct ndis_802_11_ssid *pssid,u8 *da,int wait_ack)Not related to your patch. But maybe in a later patch you can change int
wait_ackto boolwait_ack, as it is only taking true and false as its argument.
Quoted 2 lines
regards
sudip
Okay, I'll send that as a separate patch.
Signature · 1 line
Amitoj