staging: rtl8188eu: Remove unnecessary functions
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.
Amitoj Kaur Chawla (3):
staging: rtl8188eu: core: 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 | 24 +++++------- drivers/staging/rtl8188eu/core/rtw_xmit.c | 5 --- drivers/staging/rtl8188eu/include/rtw_xmit.h | 1 - 4 files changed, 10 insertions(+), 74 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/3 staging: rtl8188eu: core: Remove unnecessary functions
Drop unnecessary functions that are declared but not being used.
--- 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 2/3 staging: rtl8188eu: Remove unused function
In reply to Amitoj Kaur ChawlaRemove function that is declared but not called anywhere.
--- 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 3/3 staging: rtl8188eu: core: Remove wrapper function
In reply to Amitoj Kaur ChawlaRemove wrapper function that can be replaced by a single line of code.
--- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-)
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +9 -15
@@ -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)
@@ -2029,24 +2023,24 @@ 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 +4814,9 @@ 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 3/3] staging: rtl8188eu: core: Remove wrapper function
Quoted 12 lines · Amitoj Kaur Chawla
Remove wrapper function that can be replaced by a single line of code.
Signed-off-by Amitoj Kaur Chawla <[email protected]>--- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-)drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +0
-0
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c exit: · line 708
Quoted 8 lines
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +0
-5@@ -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); -}
If issue_probereq is not going to be used, then maybe _issue_probereq should be renamed as issue_probereq? Is _issue_probereq actually ever called with something other than false as the last argument?
julia
Quoted 57 lines
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +9
-10static int issue_probereq_ex (struct adapter *padapter,struct ndis_802_11_ssid *pssid,u8 *da,int try_cnt,int wait_ms)@@ -2029,24 +2023,24 @@ 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 +4814,9 @@ 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); } } --1.9.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/fd49b1325d024358440e5df7b74fd18bc252cdb4.1445966850.git.amitoj1606%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Re: [Outreachy kernel] [PATCH 3/3] staging: rtl8188eu: core: Remove wrapper function
Quoted 20 lines · Julia Lawall
Quoted 15 lines · Amitoj Kaur Chawla
Remove wrapper function that can be replaced by a single line of code.
Signed-off-by Amitoj Kaur Chawla <[email protected]>--- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-)drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +0
-0@@ -701,12 +701,6 @@ exit:return ret; }
Quoted 9 lines
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c exit: · line 708
Quoted 5 lines
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +0
-5-static inline void issue_probereq (struct adapter *padapter, -struct ndis_802_11_ssid *pssid,u8 *da) -{ -_issue_probereq (padapter, pssid, da, false); -}If
issue_probereqis not going to be used, then maybe_issue_probereqshould be renamed asissue_probereq? Is_issue_probereqactually ever called with something other than false as the last argument?
I can rename it to issue_probereq.
It isn't called anywhere with something other than false. Your thoughts?
Signature · 1 line
Amitoj
Re: [Outreachy kernel] [PATCH 3/3] staging: rtl8188eu: core: Remove wrapper function
Quoted 31 lines · Amitoj Kaur Chawla
Quoted 20 lines · Julia Lawall
Quoted 15 lines · Amitoj Kaur Chawla
Remove wrapper function that can be replaced by a single line of code.
Signed-off-by Amitoj Kaur Chawla <[email protected]>--- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-)drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +0
-0@@ -701,12 +701,6 @@ exit:return ret; }Quoted 9 lines
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c exit: · line 708
Quoted 5 lines
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +0
-5-static inline void issue_probereq (struct adapter *padapter, -struct ndis_802_11_ssid *pssid,u8 *da) -{ -_issue_probereq (padapter, pssid, da, false); -}If
issue_probereqis not going to be used, then maybe_issue_probereqshould be renamed asissue_probereq? Is_issue_probereqactually ever called with something other than false as the last argument?
Quoted 4 lines
I can rename it to
issue_probereq.It isn't called anywhere with something other than false. Your thoughts?
If you are sure that the argument is always false, maybe it could be simplified away. It looks like the whole setup with the _ was a hack to allow that value to vary in some case, but maybe it isn't needed any more.
julia
Re: [Outreachy kernel] [PATCH 3/3] staging: rtl8188eu: core: Remove wrapper function
Quoted 37 lines · Julia Lawall
Quoted 33 lines · Amitoj Kaur Chawla
Quoted 20 lines · Julia Lawall
Quoted 15 lines · Amitoj Kaur Chawla
Remove wrapper function that can be replaced by a single line of code.
Signed-off-by Amitoj Kaur Chawla <[email protected]>--- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-)drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +0
-0@@ -701,12 +701,6 @@ exit:return ret; }Quoted 9 lines
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c exit: · line 708
Quoted 5 lines
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +0
-5-static inline void issue_probereq (struct adapter *padapter, -struct ndis_802_11_ssid *pssid,u8 *da) -{ -_issue_probereq (padapter, pssid, da, false); -}If
issue_probereqis not going to be used, then maybe_issue_probereqshould be renamed asissue_probereq? Is_issue_probereqactually ever called with something other than false as the last argument?I can rename it to
issue_probereq.
Quoted 8 lines
Quoted 2 lines
It isn't called anywhere with something other than false. Your thoughts?
If you are sure that the argument is always false, maybe it could be simplified away. It looks like the whole setup with the _ was a hack to allow that value to vary in some case, but maybe it isn't needed any more.
julia
In the function _issue_probereq there's an if condition based on the argument that is always false. So we can remove the if condition for the argument being true.
Signature · 1 line
Amitoj