mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/4] staging: rtl8188eu: Remove code valid only for 5 GHz
@ 2018-09-03 18:24 Michael Straube
  2018-09-03 18:24 ` [PATCH 2/4] staging: rtl8188eu: fix comparsions to true Michael Straube
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael Straube @ 2018-09-03 18:24 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Remove code that is only valid for channels > 14.
This addresses the below TODO item.

- find and remove remaining code valid only for 5 GHz. Most of the obvious
  ones have been removed, but things like channel > 14 still exist.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 .../staging/rtl8188eu/core/rtw_wlan_util.c    | 47 +++++++------------
 1 file changed, 17 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index b9406583e501..8f87db11f87e 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -110,22 +110,16 @@ u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int ratelen
 	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
 	struct mlme_ext_info	*pmlmeinfo = &(pmlmeext->mlmext_info);
 
-	if (pmlmeext->cur_channel > 14) {
-		if (pmlmeinfo->HT_enable)
-			network_type = WIRELESS_11_5N;
+	if (pmlmeinfo->HT_enable)
+		network_type = WIRELESS_11_24N;
+
+	if ((cckratesonly_included(rate, ratelen)) == true)
+		network_type |= WIRELESS_11B;
+	else if ((cckrates_included(rate, ratelen)) == true)
+		network_type |= WIRELESS_11BG;
+	else
+		network_type |= WIRELESS_11G;
 
-		network_type |= WIRELESS_11A;
-	} else {
-		if (pmlmeinfo->HT_enable)
-			network_type = WIRELESS_11_24N;
-
-		if ((cckratesonly_included(rate, ratelen)) == true)
-			network_type |= WIRELESS_11B;
-		else if ((cckrates_included(rate, ratelen)) == true)
-			network_type |= WIRELESS_11BG;
-		else
-			network_type |= WIRELESS_11G;
-	}
 	return	network_type;
 }
 
@@ -1429,22 +1423,15 @@ void update_wireless_mode(struct adapter *padapter)
 	if ((pmlmeinfo->HT_info_enable) && (pmlmeinfo->HT_caps_enable))
 		pmlmeinfo->HT_enable = 1;
 
-	if (pmlmeext->cur_channel > 14) {
-		if (pmlmeinfo->HT_enable)
-			network_type = WIRELESS_11_5N;
+	if (pmlmeinfo->HT_enable)
+		network_type = WIRELESS_11_24N;
 
-		network_type |= WIRELESS_11A;
-	} else {
-		if (pmlmeinfo->HT_enable)
-			network_type = WIRELESS_11_24N;
-
-		if ((cckratesonly_included(rate, ratelen)) == true)
-			network_type |= WIRELESS_11B;
-		else if ((cckrates_included(rate, ratelen)) == true)
-			network_type |= WIRELESS_11BG;
-		else
-			network_type |= WIRELESS_11G;
-	}
+	if ((cckratesonly_included(rate, ratelen)) == true)
+		network_type |= WIRELESS_11B;
+	else if ((cckrates_included(rate, ratelen)) == true)
+		network_type |= WIRELESS_11BG;
+	else
+		network_type |= WIRELESS_11G;
 
 	pmlmeext->cur_wireless_mode = network_type & padapter->registrypriv.wireless_mode;
 
-- 
2.18.0


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

* [PATCH 2/4] staging: rtl8188eu: fix comparsions to true
  2018-09-03 18:24 [PATCH 1/4] staging: rtl8188eu: Remove code valid only for 5 GHz Michael Straube
@ 2018-09-03 18:24 ` Michael Straube
  2018-09-03 18:24 ` [PATCH 3/4] staging: rtl8188eu: remove whitespace Michael Straube
  2018-09-03 18:24 ` [PATCH 4/4] staging: rtl8188eu: remove unnecessary parentheses Michael Straube
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Straube @ 2018-09-03 18:24 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

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

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index 8f87db11f87e..20d7bba2cfd4 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -113,9 +113,9 @@ u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int ratelen
 	if (pmlmeinfo->HT_enable)
 		network_type = WIRELESS_11_24N;
 
-	if ((cckratesonly_included(rate, ratelen)) == true)
+	if (cckratesonly_included(rate, ratelen))
 		network_type |= WIRELESS_11B;
-	else if ((cckrates_included(rate, ratelen)) == true)
+	else if (cckrates_included(rate, ratelen))
 		network_type |= WIRELESS_11BG;
 	else
 		network_type |= WIRELESS_11G;
@@ -1426,9 +1426,9 @@ void update_wireless_mode(struct adapter *padapter)
 	if (pmlmeinfo->HT_enable)
 		network_type = WIRELESS_11_24N;
 
-	if ((cckratesonly_included(rate, ratelen)) == true)
+	if (cckratesonly_included(rate, ratelen))
 		network_type |= WIRELESS_11B;
-	else if ((cckrates_included(rate, ratelen)) == true)
+	else if (cckrates_included(rate, ratelen))
 		network_type |= WIRELESS_11BG;
 	else
 		network_type |= WIRELESS_11G;
-- 
2.18.0


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

* [PATCH 3/4] staging: rtl8188eu: remove whitespace
  2018-09-03 18:24 [PATCH 1/4] staging: rtl8188eu: Remove code valid only for 5 GHz Michael Straube
  2018-09-03 18:24 ` [PATCH 2/4] staging: rtl8188eu: fix comparsions to true Michael Straube
@ 2018-09-03 18:24 ` Michael Straube
  2018-09-03 18:24 ` [PATCH 4/4] staging: rtl8188eu: remove unnecessary parentheses Michael Straube
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Straube @ 2018-09-03 18:24 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Replace tabs with spaces where appropriate.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index 20d7bba2cfd4..a911c254b386 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -107,8 +107,8 @@ unsigned char networktype_to_raid(unsigned char network_type)
 u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int ratelen)
 {
 	u8 network_type = 0;
-	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
-	struct mlme_ext_info	*pmlmeinfo = &(pmlmeext->mlmext_info);
+	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
+	struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
 
 	if (pmlmeinfo->HT_enable)
 		network_type = WIRELESS_11_24N;
@@ -120,7 +120,7 @@ u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int ratelen
 	else
 		network_type |= WIRELESS_11G;
 
-	return	network_type;
+	return network_type;
 }
 
 static unsigned char ratetbl_val_2wifirate(unsigned char rate)
@@ -1413,10 +1413,10 @@ void update_wireless_mode(struct adapter *padapter)
 {
 	int ratelen, network_type = 0;
 	u32 SIFS_Timer;
-	struct mlme_ext_priv	*pmlmeext = &padapter->mlmeextpriv;
-	struct mlme_ext_info	*pmlmeinfo = &(pmlmeext->mlmext_info);
-	struct wlan_bssid_ex	*cur_network = &(pmlmeinfo->network);
-	unsigned char		*rate = cur_network->SupportedRates;
+	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
+	struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
+	struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network);
+	unsigned char *rate = cur_network->SupportedRates;
 
 	ratelen = rtw_get_rateset_len(cur_network->SupportedRates);
 
-- 
2.18.0


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

* [PATCH 4/4] staging: rtl8188eu: remove unnecessary parentheses
  2018-09-03 18:24 [PATCH 1/4] staging: rtl8188eu: Remove code valid only for 5 GHz Michael Straube
  2018-09-03 18:24 ` [PATCH 2/4] staging: rtl8188eu: fix comparsions to true Michael Straube
  2018-09-03 18:24 ` [PATCH 3/4] staging: rtl8188eu: remove whitespace Michael Straube
@ 2018-09-03 18:24 ` Michael Straube
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Straube @ 2018-09-03 18:24 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Remove unnecessary parentheses to follow kernel coding style
and clean checkpatch issues.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index a911c254b386..3e0801858737 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -108,7 +108,7 @@ u8 judge_network_type(struct adapter *padapter, unsigned char *rate, int ratelen
 {
 	u8 network_type = 0;
 	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
-	struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
+	struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
 
 	if (pmlmeinfo->HT_enable)
 		network_type = WIRELESS_11_24N;
@@ -1414,13 +1414,13 @@ void update_wireless_mode(struct adapter *padapter)
 	int ratelen, network_type = 0;
 	u32 SIFS_Timer;
 	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
-	struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
-	struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network);
+	struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
+	struct wlan_bssid_ex *cur_network = &pmlmeinfo->network;
 	unsigned char *rate = cur_network->SupportedRates;
 
 	ratelen = rtw_get_rateset_len(cur_network->SupportedRates);
 
-	if ((pmlmeinfo->HT_info_enable) && (pmlmeinfo->HT_caps_enable))
+	if (pmlmeinfo->HT_info_enable && pmlmeinfo->HT_caps_enable)
 		pmlmeinfo->HT_enable = 1;
 
 	if (pmlmeinfo->HT_enable)
-- 
2.18.0


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

end of thread, other threads:[~2018-09-03 18:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-03 18:24 [PATCH 1/4] staging: rtl8188eu: Remove code valid only for 5 GHz Michael Straube
2018-09-03 18:24 ` [PATCH 2/4] staging: rtl8188eu: fix comparsions to true Michael Straube
2018-09-03 18:24 ` [PATCH 3/4] staging: rtl8188eu: remove whitespace Michael Straube
2018-09-03 18:24 ` [PATCH 4/4] staging: rtl8188eu: remove unnecessary parentheses Michael Straube

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome