public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] staging: rtl8188eu: remove 5 GHz code from Hal_GetChnlGroup88E()
@ 2018-09-19 20:39 Michael Straube
  2018-09-19 20:39 ` [PATCH 2/4] staging: rtl8188eu: change return type of Hal_GetChnlGroup88E() Michael Straube
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael Straube @ 2018-09-19 20:39 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Remove code valid only for 5 GHz from Hal_GetChnlGroup88E().
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/hal/rtl8188e_hal_init.c | 60 ++++---------------
 1 file changed, 13 insertions(+), 47 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
index 607170775fa5..69693126e102 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
@@ -382,53 +382,19 @@ static u8 Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup)
 {
 	u8 bIn24G = true;
 
-	if (chnl <= 14) {
-		bIn24G = true;
-
-		if (chnl < 3)			/*  Channel 1-2 */
-			*pGroup = 0;
-		else if (chnl < 6)		/*  Channel 3-5 */
-			*pGroup = 1;
-		else	 if (chnl < 9)		/*  Channel 6-8 */
-			*pGroup = 2;
-		else if (chnl < 12)		/*  Channel 9-11 */
-			*pGroup = 3;
-		else if (chnl < 14)		/*  Channel 12-13 */
-			*pGroup = 4;
-		else if (chnl == 14)		/*  Channel 14 */
-			*pGroup = 5;
-	} else {
-		/* probably, this branch is suitable only for 5 GHz */
-
-		bIn24G = false;
-
-		if (chnl <= 40)
-			*pGroup = 0;
-		else if (chnl <= 48)
-			*pGroup = 1;
-		else	 if (chnl <= 56)
-			*pGroup = 2;
-		else if (chnl <= 64)
-			*pGroup = 3;
-		else if (chnl <= 104)
-			*pGroup = 4;
-		else if (chnl <= 112)
-			*pGroup = 5;
-		else if (chnl <= 120)
-			*pGroup = 5;
-		else if (chnl <= 128)
-			*pGroup = 6;
-		else if (chnl <= 136)
-			*pGroup = 7;
-		else if (chnl <= 144)
-			*pGroup = 8;
-		else if (chnl <= 153)
-			*pGroup = 9;
-		else if (chnl <= 161)
-			*pGroup = 10;
-		else if (chnl <= 177)
-			*pGroup = 11;
-	}
+	if (chnl < 3)			/*  Channel 1-2 */
+		*pGroup = 0;
+	else if (chnl < 6)		/*  Channel 3-5 */
+		*pGroup = 1;
+	else if (chnl < 9)		/*  Channel 6-8 */
+		*pGroup = 2;
+	else if (chnl < 12)		/*  Channel 9-11 */
+		*pGroup = 3;
+	else if (chnl < 14)		/*  Channel 12-13 */
+		*pGroup = 4;
+	else if (chnl == 14)		/*  Channel 14 */
+		*pGroup = 5;
+
 	return bIn24G;
 }
 
-- 
2.19.0


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

end of thread, other threads:[~2018-09-19 20:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-19 20:39 [PATCH 1/4] staging: rtl8188eu: remove 5 GHz code from Hal_GetChnlGroup88E() Michael Straube
2018-09-19 20:39 ` [PATCH 2/4] staging: rtl8188eu: change return type of Hal_GetChnlGroup88E() Michael Straube
2018-09-19 20:40 ` [PATCH 3/4] staging: rtl8188eu: rename parameter " Michael Straube
2018-09-19 20:40 ` [PATCH 4/4] staging: rtl8188eu: clean function definitions - style Michael Straube

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