Skip to contentSkip to conversation

staging: rtl8188eu: remove unused dump_txrpt_ccx_88e()

PATCH In review Michael Straube 2 participants 11 messages Jul 29, 2018 – Jul 30, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/7 staging: rtl8188eu: remove unused dump_txrpt_ccx_88e()

The function dump_txrpt_ccx_88e() is nerver used, so remove it. Discovered by cppcheck.

---
v2: removed last patch (8/8) from the series

 drivers/staging/rtl8188eu/hal/rtl8188e_xmit.c | 22 -------------------
 .../staging/rtl8188eu/include/rtl8188e_xmit.h |  1 -
 2 files changed, 23 deletions(-)
drivers/staging/rtl8188eu/hal/rtl8188e_xmit.c +0 -22
index 6883746f3b8b..9b8a284544ac 100644
@@ -10,28 +10,6 @@
 #include <drv_types.h>
 #include <rtl8188e_hal.h>
 
-void dump_txrpt_ccx_88e(void *buf)
-{
-	struct txrpt_ccx_88e *txrpt_ccx = buf;
-
-	DBG_88E("%s:\n"
-		"tag1:%u, pkt_num:%u, txdma_underflow:%u, int_bt:%u, int_tri:%u, int_ccx:%u\n"
-		"mac_id:%u, pkt_ok:%u, bmc:%u\n"
-		"retry_cnt:%u, lifetime_over:%u, retry_over:%u\n"
-		"ccx_qtime:%u\n"
-		"final_data_rate:0x%02x\n"
-		"qsel:%u, sw:0x%03x\n",
-		__func__, txrpt_ccx->tag1, txrpt_ccx->pkt_num,
-		txrpt_ccx->txdma_underflow, txrpt_ccx->int_bt,
-		txrpt_ccx->int_tri, txrpt_ccx->int_ccx,
-		txrpt_ccx->mac_id, txrpt_ccx->pkt_ok, txrpt_ccx->bmc,
-		txrpt_ccx->retry_cnt, txrpt_ccx->lifetime_over,
-		txrpt_ccx->retry_over, txrpt_ccx_qtime_88e(txrpt_ccx),
-		txrpt_ccx->final_data_rate, txrpt_ccx->qsel,
-		txrpt_ccx_sw_88e(txrpt_ccx)
-	);
-}
-
 void handle_txrpt_ccx_88e(struct adapter *adapter, u8 *buf)
 {
 	struct txrpt_ccx_88e *txrpt_ccx = (struct txrpt_ccx_88e *)buf;
drivers/staging/rtl8188eu/include/rtl8188e_xmit.h +0 -1
index 17e7b3016674..20d35480dab8 100644
@@ -152,7 +152,6 @@ void rtl8188eu_xmit_tasklet(void *priv);
 s32 rtl8188eu_xmitframe_complete(struct adapter *padapter,
 				 struct xmit_priv *pxmitpriv);
 
-void dump_txrpt_ccx_88e(void *buf);
 void handle_txrpt_ccx_88e(struct adapter *adapter, u8 *buf);
 
 void _dbg_dump_tx_info(struct adapter *padapter, int frame_tag,
Signature · 1 line
2.18.0
#1 lore raw

PATCH v2 2/7 staging: rtl8188eu: remove unused should_forbid_n_rate()

The function should_forbid_n_rate() is never used, so remove it. Discovered by cppcheck.

---
 .../staging/rtl8188eu/core/rtw_wlan_util.c    | 35 -------------------
 .../staging/rtl8188eu/include/rtw_mlme_ext.h  |  1 -
 2 files changed, 36 deletions(-)
drivers/staging/rtl8188eu/core/rtw_wlan_util.c +0 -35
index 0fe35e141926..b9406583e501 100644
@@ -1094,41 +1094,6 @@ unsigned int is_ap_in_tkip(struct adapter *padapter)
 	}
 }
 
-unsigned int should_forbid_n_rate(struct adapter *padapter)
-{
-	u32 i;
-	struct ndis_802_11_var_ie *pIE;
-	struct mlme_priv	*pmlmepriv = &padapter->mlmepriv;
-	struct wlan_bssid_ex  *cur_network = &pmlmepriv->cur_network.network;
-
-	if (rtw_get_capability((struct wlan_bssid_ex *)cur_network) & WLAN_CAPABILITY_PRIVACY) {
-		for (i = sizeof(struct ndis_802_11_fixed_ie); i < cur_network->ie_length;) {
-			pIE = (struct ndis_802_11_var_ie *)(cur_network->ies + i);
-
-			switch (pIE->ElementID) {
-			case _VENDOR_SPECIFIC_IE_:
-				if (!memcmp(pIE->data, RTW_WPA_OUI, 4) &&
-				    ((!memcmp((pIE->data + 12), WPA_CIPHER_SUITE_CCMP, 4)) ||
-				    (!memcmp((pIE->data + 16), WPA_CIPHER_SUITE_CCMP, 4))))
-					return false;
-				break;
-			case _RSN_IE_2_:
-				if  ((!memcmp((pIE->data + 8), RSN_CIPHER_SUITE_CCMP, 4))  ||
-				       (!memcmp((pIE->data + 12), RSN_CIPHER_SUITE_CCMP, 4)))
-					return false;
-			default:
-				break;
-			}
-
-			i += (pIE->Length + 2);
-		}
-
-		return true;
-	} else {
-		return false;
-	}
-}
-
 unsigned int is_ap_in_wep(struct adapter *padapter)
 {
 	u32 i;
drivers/staging/rtl8188eu/include/rtw_mlme_ext.h +0 -1
index c072e1e25d61..ade68af15e04 100644
@@ -534,7 +534,6 @@ unsigned char get_highest_rate_idx(u32 mask);
 int support_short_GI(struct adapter *padapter, struct ieee80211_ht_cap *caps);
 unsigned int is_ap_in_tkip(struct adapter *padapter);
 unsigned int is_ap_in_wep(struct adapter *padapter);
-unsigned int should_forbid_n_rate(struct adapter *padapter);
 
 void report_join_res(struct adapter *padapter, int res);
 void report_survey_event(struct adapter *padapter,
Signature · 1 line
2.18.0
#2 lore raw

PATCH v2 3/7 staging: rtl8188eu: remove unused rtw_handle_tkip_mic_err()

In reply to Michael Straube

The function rtw_handle_tkip_mic_err() is never used, so remove it. Discovered by cppcheck.

---
 .../staging/rtl8188eu/include/recv_osdep.h    |  2 --
 drivers/staging/rtl8188eu/os_dep/recv_linux.c | 36 -------------------
 2 files changed, 38 deletions(-)
drivers/staging/rtl8188eu/include/recv_osdep.h +0 -2
index d2341521cc8e..2c05964b757d 100644
@@ -19,8 +19,6 @@ s32  rtw_recv_entry(struct recv_frame *precv_frame);
 int rtw_recv_indicatepkt(struct adapter *adapter,
 			 struct recv_frame *recv_frame);
 
-void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup);
-
 int rtw_os_recvbuf_resource_alloc(struct adapter *adapt, struct recv_buf *buf);
 
 void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl);
drivers/staging/rtl8188eu/os_dep/recv_linux.c +0 -36
index deadf26ea2aa..148ee94bbf3d 100644
@@ -25,42 +25,6 @@ int rtw_os_recvbuf_resource_alloc(struct adapter *padapter,
 	return _SUCCESS;
 }
 
-void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup)
-{
-	union iwreq_data wrqu;
-	struct iw_michaelmicfailure ev;
-	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-	struct security_priv *psecuritypriv = &padapter->securitypriv;
-	u32 cur_time = 0;
-
-	if (psecuritypriv->last_mic_err_time == 0) {
-		psecuritypriv->last_mic_err_time = jiffies;
-	} else {
-		cur_time = jiffies;
-
-		if (cur_time - psecuritypriv->last_mic_err_time < 60*HZ) {
-			psecuritypriv->btkip_countermeasure = true;
-			psecuritypriv->last_mic_err_time = 0;
-			psecuritypriv->btkip_countermeasure_time = cur_time;
-		} else {
-			psecuritypriv->last_mic_err_time = jiffies;
-		}
-	}
-
-	memset(&ev, 0x00, sizeof(ev));
-	if (bgroup)
-		ev.flags |= IW_MICFAILURE_GROUP;
-	else
-		ev.flags |= IW_MICFAILURE_PAIRWISE;
-
-	ev.src_addr.sa_family = ARPHRD_ETHER;
-	memcpy(ev.src_addr.sa_data, &pmlmepriv->assoc_bssid[0], ETH_ALEN);
-	memset(&wrqu, 0x00, sizeof(wrqu));
-	wrqu.data.length = sizeof(ev);
-	wireless_send_event(padapter->pnetdev, IWEVMICHAELMICFAILURE,
-			    &wrqu, (char *)&ev);
-}
-
 int rtw_recv_indicatepkt(struct adapter *padapter,
 			 struct recv_frame *precv_frame)
 {
Signature · 1 line
2.18.0
#7 lore raw

PATCH v2 4/7 staging: rtl8188eu: remove redundant includes

In reply to Michael Straube

Both osdep_service.h and drv_types.h are included from hal_intf.h, so remove the redundant includes from hal_intf.c.

---
 drivers/staging/rtl8188eu/hal/hal_intf.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/rtl8188eu/hal/hal_intf.c +0 -2
index aaa1718ca603..0baf4e616b6a 100644
@@ -6,8 +6,6 @@
  ******************************************************************************/
 
 #define _HAL_INTF_C_
-#include <osdep_service.h>
-#include <drv_types.h>
 #include <hal_intf.h>
 
 uint	 rtw_hal_init(struct adapter *adapt)
Signature · 1 line
2.18.0
#9 lore raw

PATCH v2 6/7 staging: rtl8188eu: fix comparsion to true

In reply to Michael Straube

Use if(x) instead of if(x == true).

---
 drivers/staging/rtl8188eu/hal/hal_intf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8188eu/hal/hal_intf.c +1 -1
index c43e7b438058..b21ba01abc57 100644
@@ -50,7 +50,7 @@ void rtw_hal_update_ra_mask(struct adapter *adapt, u32 mac_id, u8 rssi_level)
 {
 	struct mlme_priv *pmlmepriv = &(adapt->mlmepriv);
 
-	if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
+	if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
 #ifdef CONFIG_88EU_AP_MODE
 		struct sta_info *psta = NULL;
 		struct sta_priv *pstapriv = &adapt->stapriv;
Signature · 1 line
2.18.0
#10 lore raw

PATCH v2 7/7 staging: rtl8188eu: remove unnecessary parentheses

In reply to Michael Straube

Remove unnecessary parentheses, also clears checkpatch issues about missing spaces around '-'.

---
 drivers/staging/rtl8188eu/hal/hal_intf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8188eu/hal/hal_intf.c +3 -3
index b21ba01abc57..b8fecc952cfc 100644
@@ -48,15 +48,15 @@ uint rtw_hal_deinit(struct adapter *adapt)
 
 void rtw_hal_update_ra_mask(struct adapter *adapt, u32 mac_id, u8 rssi_level)
 {
-	struct mlme_priv *pmlmepriv = &(adapt->mlmepriv);
+	struct mlme_priv *pmlmepriv = &adapt->mlmepriv;
 
 	if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
 #ifdef CONFIG_88EU_AP_MODE
 		struct sta_info *psta = NULL;
 		struct sta_priv *pstapriv = &adapt->stapriv;
 
-		if ((mac_id-1) > 0)
-			psta = pstapriv->sta_aid[(mac_id-1) - 1];
+		if (mac_id - 1 > 0)
+			psta = pstapriv->sta_aid[mac_id - 2];
 		if (psta)
 			add_RATid(adapt, psta, 0);/* todo: based on rssi_level*/
 #endif
Signature · 1 line
2.18.0
#8 lore raw

PATCH v2 5/7 staging: rtl8188eu: replace tabs with spaces

In reply to Michael Straube

Replace tabs with spaces in function definition and variable declarations.

---
 drivers/staging/rtl8188eu/hal/hal_intf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8188eu/hal/hal_intf.c +3 -3
index 0baf4e616b6a..c43e7b438058 100644
@@ -8,9 +8,9 @@
 #define _HAL_INTF_C_
 #include <hal_intf.h>
 
-uint	 rtw_hal_init(struct adapter *adapt)
+uint rtw_hal_init(struct adapter *adapt)
 {
-	uint	status = _SUCCESS;
+	uint status = _SUCCESS;
 
 	adapt->hw_init_completed = false;
 
@@ -34,7 +34,7 @@ uint	 rtw_hal_init(struct adapter *adapt)
 
 uint rtw_hal_deinit(struct adapter *adapt)
 {
-	uint	status = _SUCCESS;
+	uint status = _SUCCESS;
 
 	status = rtl8188eu_hal_deinit(adapt);
 
Signature · 1 line
2.18.0
maintainer
#3 lore raw

Re: [PATCH v2 3/7] staging: rtl8188eu: remove unused rtw_handle_tkip_mic_err()

In reply to Michael Straube
Quoted 2 lines · Michael Straube

The function rtw_handle_tkip_mic_err() is never used, so remove it. Discovered by cppcheck.

That's a bad tool then, as this is used, and the build breaks when this patch is applied :(

I've dropped it now.

thanks,

greg k-h

#4 lore raw

Re: [PATCH v2 3/7] staging: rtl8188eu: remove unused rtw_handle_tkip_mic_err()

Quoted 4 lines · Greg KH
Quoted 2 lines · Michael Straube

The function rtw_handle_tkip_mic_err() is never used, so remove it. Discovered by cppcheck.

Quoted 9 lines

That's a bad tool then, as this is used, and the build breaks when this patch is applied :(

I've dropped it now.

thanks,

greg k-h

Hm, that's weired, I also checked with:

git grep -n rtw_handle_tkip_mic_err drivers/staging/rtl8188eu/

There were/are no uses and the driver builds and works fine here. I don't see what I may have missed here. :(

Regards,
Michael

#5 lore raw

Re: [PATCH v2 3/7] staging: rtl8188eu: remove unused rtw_handle_tkip_mic_err()

Quoted 17 lines · Michael Straube
Quoted 4 lines · Greg KH
Quoted 2 lines · Michael Straube

The function rtw_handle_tkip_mic_err() is never used, so remove it. Discovered by cppcheck.

Quoted 9 lines

That's a bad tool then, as this is used, and the build breaks when this patch is applied :(

I've dropped it now.

thanks,

greg k-h

Hm, that's weired, I also checked with:

Quoted 7 lines

git grep -n rtw_handle_tkip_mic_err drivers/staging/rtl8188eu/

There were/are no uses and the driver builds and works fine here. I don't see what I may have missed here. :(

Regards,
Michael

The use of rtw_handle_tkip_mic_err() was added back in commit

69a1d98c831ec64cbfd381f5dcb6697e1445d239 Revert "staging:r8188eu: Use lib80211 to support TKIP"

which was applied with 'Merge 4.18-rc7 into staging-next'.

That was not applied when I sent the patch yesterday, sorry for the trouble.

Michael

maintainer
#6 lore raw

Re: [PATCH v2 3/7] staging: rtl8188eu: remove unused rtw_handle_tkip_mic_err()

Quoted 28 lines · Michael Straube
Quoted 17 lines · Michael Straube
Quoted 4 lines · Greg KH
Quoted 2 lines · Michael Straube

The function rtw_handle_tkip_mic_err() is never used, so remove it. Discovered by cppcheck.

Quoted 9 lines

That's a bad tool then, as this is used, and the build breaks when this patch is applied :(

I've dropped it now.

thanks,

greg k-h

Hm, that's weired, I also checked with:

Quoted 7 lines

git grep -n rtw_handle_tkip_mic_err drivers/staging/rtl8188eu/

There were/are no uses and the driver builds and works fine here. I don't see what I may have missed here. :(

Regards,
Michael

The use of rtw_handle_tkip_mic_err() was added back in commit

Quoted 7 lines

69a1d98c831ec64cbfd381f5dcb6697e1445d239 Revert "staging:r8188eu: Use lib80211 to support TKIP"

which was applied with 'Merge 4.18-rc7 into staging-next'.

That was not applied when I sent the patch yesterday, sorry for the trouble.

Ah, that makes more sense, sorry for the noise, I should have caught that.

greg k-h