All of lore.kernel.org
 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; 5+ 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 related	[flat|nested] 5+ 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; 5+ 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 related	[flat|nested] 5+ 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; 5+ 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 related	[flat|nested] 5+ 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; 5+ 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 related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] staging: rtl8188eu: remove unnecessary parentheses
  2019-04-22  9:58 [PATCH 1/4] staging: rtl8188eu: add spaces around operators in rtw_ap.c Michael Straube
@ 2019-04-22  9:58 ` Michael Straube
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Straube @ 2019-04-22  9:58 UTC (permalink / raw)
  To: gregkh; +Cc: Larry.Finger, devel, linux-kernel, Michael Straube

Remove unnecessary parentheses to improve readability.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_ap.c  | 6 +++---
 drivers/staging/rtl8188eu/core/rtw_cmd.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c b/drivers/staging/rtl8188eu/core/rtw_ap.c
index 9588ba2a16e4..51a5b71f8c25 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ap.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
@@ -1174,15 +1174,15 @@ static void update_bcn_wps_ie(struct adapter *padapter)
 	}
 
 	wps_ielen = (uint)pwps_ie_src[1];/* to get ie data len */
-	if ((wps_offset + wps_ielen + 2 + remainder_ielen) <= MAX_IE_SZ) {
+	if (wps_offset + wps_ielen + 2 + remainder_ielen <= MAX_IE_SZ) {
 		memcpy(pwps_ie, pwps_ie_src, wps_ielen + 2);
-		pwps_ie += (wps_ielen + 2);
+		pwps_ie += wps_ielen + 2;
 
 		if (pbackup_remainder_ie)
 			memcpy(pwps_ie, pbackup_remainder_ie, remainder_ielen);
 
 		/* update ie_length */
-		pnetwork->ie_length = wps_offset + (wps_ielen + 2) + remainder_ielen;
+		pnetwork->ie_length = wps_offset + wps_ielen + 2 + remainder_ielen;
 	}
 
 	kfree(pbackup_remainder_ie);
diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index 61da56a3bbc4..a24b40761af2 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -405,7 +405,7 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct wlan_network *pnetwork)
 
 	psecuritypriv->authenticator_ie[0] = (unsigned char)psecnetwork->ie_length;
 
-	if ((psecnetwork->ie_length - 12) < 255)
+	if (psecnetwork->ie_length - 12 < 255)
 		memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->ies[12], psecnetwork->ie_length - 12);
 	else
 		memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->ies[12], 255);
-- 
2.21.0


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

end of thread, other threads:[~2019-04-22  9:58 UTC | newest]

Thread overview: 5+ 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
2019-04-22  9:58 [PATCH 1/4] staging: rtl8188eu: add spaces around operators in rtw_ap.c Michael Straube
2019-04-22  9:58 ` [PATCH 4/4] staging: rtl8188eu: remove unnecessary parentheses Michael Straube

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.