linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] staging: r8188eu: refactor Hal_GetChnlGroup88E()
@ 2021-08-13  7:31 Michael Straube
  2021-08-13  7:31 ` [PATCH 1/4] staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E() Michael Straube
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Michael Straube @ 2021-08-13  7:31 UTC (permalink / raw)
  To: gregkh
  Cc: Larry.Finger, phil, martin, linux-staging, linux-kernel, Michael Straube

This series refactors Hal_GetChnlGroup88E().
 - removes 5GHz code
 - changes return type to void
 - cleans up camel case naming

Michael Straube (4):
  staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E()
  staging: r8188eu: convert return type of Hal_GetChnlGroup88E() to void
  staging: r8188eu: rename parameter of Hal_GetChnlGroup88E()
  staging: r8188eu: rename Hal_GetChnlGroup88E()

 .../staging/r8188eu/hal/rtl8188e_hal_init.c   | 90 ++++++-------------
 1 file changed, 26 insertions(+), 64 deletions(-)

-- 
2.32.0


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

* [PATCH 1/4] staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E()
  2021-08-13  7:31 [PATCH 0/4] staging: r8188eu: refactor Hal_GetChnlGroup88E() Michael Straube
@ 2021-08-13  7:31 ` Michael Straube
  2021-08-13 16:27   ` Fabio M. De Francesco
  2021-08-14 17:11   ` Phillip Potter
  2021-08-13  7:31 ` [PATCH 2/4] staging: r8188eu: convert return type of Hal_GetChnlGroup88E() to void Michael Straube
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 13+ messages in thread
From: Michael Straube @ 2021-08-13  7:31 UTC (permalink / raw)
  To: gregkh
  Cc: Larry.Finger, phil, martin, linux-staging, linux-kernel, Michael Straube

Remove 5GHz code from Hal_GetChnlGroup88E().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 .../staging/r8188eu/hal/rtl8188e_hal_init.c   | 62 +++++--------------
 1 file changed, 14 insertions(+), 48 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
index f0560c15387c..634a0a022727 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
@@ -2062,54 +2062,20 @@ static void Hal_ReadPowerValueFromPROM_8188E(struct txpowerinfo24g *pwrInfo24G,
 
 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 {
-		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;
-	}
-	return bIn24G;
+	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 true;
 }
 
 void Hal_ReadPowerSavingMode88E(struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail)
-- 
2.32.0


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

* [PATCH 2/4] staging: r8188eu: convert return type of Hal_GetChnlGroup88E() to void
  2021-08-13  7:31 [PATCH 0/4] staging: r8188eu: refactor Hal_GetChnlGroup88E() Michael Straube
  2021-08-13  7:31 ` [PATCH 1/4] staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E() Michael Straube
@ 2021-08-13  7:31 ` Michael Straube
  2021-08-14 17:12   ` Phillip Potter
  2021-08-13  7:31 ` [PATCH 3/4] staging: r8188eu: rename parameter of Hal_GetChnlGroup88E() Michael Straube
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Michael Straube @ 2021-08-13  7:31 UTC (permalink / raw)
  To: gregkh
  Cc: Larry.Finger, phil, martin, linux-staging, linux-kernel, Michael Straube

After the removal of 5GHz code from Hal_GetChnlGroup88E() the function
always returns true now. Convert the return type to void and change the
only user Hal_ReadTxPowerInfo88E() accordingly.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 .../staging/r8188eu/hal/rtl8188e_hal_init.c   | 30 ++++++++-----------
 1 file changed, 13 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
index 634a0a022727..d3345fa0eb60 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
@@ -2060,7 +2060,7 @@ static void Hal_ReadPowerValueFromPROM_8188E(struct txpowerinfo24g *pwrInfo24G,
 	}
 }
 
-static u8 Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup)
+static void Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup)
 {
 	if (chnl < 3)			/*  Channel 1-2 */
 		*pGroup = 0;
@@ -2074,8 +2074,6 @@ static u8 Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup)
 		*pGroup = 4;
 	else if (chnl == 14)		/*  Channel 14 */
 		*pGroup = 5;
-
-	return true;
 }
 
 void Hal_ReadPowerSavingMode88E(struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail)
@@ -2107,7 +2105,7 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool Auto
 	struct hal_data_8188e	*pHalData = GET_HAL_DATA(padapter);
 	struct txpowerinfo24g pwrInfo24G;
 	u8 rfPath, ch, group;
-	u8 bIn24G, TxCount;
+	u8 TxCount;
 
 	Hal_ReadPowerValueFromPROM_8188E(&pwrInfo24G, PROMContent, AutoLoadFail);
 
@@ -2116,19 +2114,17 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool Auto
 
 	for (rfPath = 0; rfPath < pHalData->NumTotalRFPath; rfPath++) {
 		for (ch = 0; ch < CHANNEL_MAX_NUMBER; ch++) {
-			bIn24G = Hal_GetChnlGroup88E(ch, &group);
-			if (bIn24G) {
-				pHalData->Index24G_CCK_Base[rfPath][ch] = pwrInfo24G.IndexCCK_Base[rfPath][group];
-				if (ch == 14)
-					pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][4];
-				else
-					pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][group];
-			}
-			if (bIn24G) {
-				DBG_88E("======= Path %d, Channel %d =======\n", rfPath, ch);
-				DBG_88E("Index24G_CCK_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_CCK_Base[rfPath][ch]);
-				DBG_88E("Index24G_BW40_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_BW40_Base[rfPath][ch]);
-			}
+			Hal_GetChnlGroup88E(ch, &group);
+
+			pHalData->Index24G_CCK_Base[rfPath][ch] = pwrInfo24G.IndexCCK_Base[rfPath][group];
+			if (ch == 14)
+				pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][4];
+			else
+				pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][group];
+
+			DBG_88E("======= Path %d, Channel %d =======\n", rfPath, ch);
+			DBG_88E("Index24G_CCK_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_CCK_Base[rfPath][ch]);
+			DBG_88E("Index24G_BW40_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_BW40_Base[rfPath][ch]);
 		}
 		for (TxCount = 0; TxCount < MAX_TX_COUNT; TxCount++) {
 			pHalData->CCK_24G_Diff[rfPath][TxCount] = pwrInfo24G.CCK_Diff[rfPath][TxCount];
-- 
2.32.0


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

* [PATCH 3/4] staging: r8188eu: rename parameter of Hal_GetChnlGroup88E()
  2021-08-13  7:31 [PATCH 0/4] staging: r8188eu: refactor Hal_GetChnlGroup88E() Michael Straube
  2021-08-13  7:31 ` [PATCH 1/4] staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E() Michael Straube
  2021-08-13  7:31 ` [PATCH 2/4] staging: r8188eu: convert return type of Hal_GetChnlGroup88E() to void Michael Straube
@ 2021-08-13  7:31 ` Michael Straube
  2021-08-14 17:12   ` Phillip Potter
  2021-08-13  7:31 ` [PATCH 4/4] staging: r8188eu: rename Hal_GetChnlGroup88E() Michael Straube
  2021-08-13  9:44 ` [PATCH 0/4] staging: r8188eu: refactor Hal_GetChnlGroup88E() Martin Kaiser
  4 siblings, 1 reply; 13+ messages in thread
From: Michael Straube @ 2021-08-13  7:31 UTC (permalink / raw)
  To: gregkh
  Cc: Larry.Finger, phil, martin, linux-staging, linux-kernel, Michael Straube

Rename parameter of Hal_GetChnlGroup88E() to avoid camel case.
pGroup -> group

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

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
index d3345fa0eb60..07ba5f0eecc2 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
@@ -2060,20 +2060,20 @@ static void Hal_ReadPowerValueFromPROM_8188E(struct txpowerinfo24g *pwrInfo24G,
 	}
 }
 
-static void Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup)
+static void Hal_GetChnlGroup88E(u8 chnl, u8 *group)
 {
 	if (chnl < 3)			/*  Channel 1-2 */
-		*pGroup = 0;
+		*group = 0;
 	else if (chnl < 6)		/*  Channel 3-5 */
-		*pGroup = 1;
+		*group = 1;
 	else if (chnl < 9)		/*  Channel 6-8 */
-		*pGroup = 2;
+		*group = 2;
 	else if (chnl < 12)		/*  Channel 9-11 */
-		*pGroup = 3;
+		*group = 3;
 	else if (chnl < 14)		/*  Channel 12-13 */
-		*pGroup = 4;
+		*group = 4;
 	else if (chnl == 14)		/*  Channel 14 */
-		*pGroup = 5;
+		*group = 5;
 }
 
 void Hal_ReadPowerSavingMode88E(struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail)
-- 
2.32.0


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

* [PATCH 4/4] staging: r8188eu: rename Hal_GetChnlGroup88E()
  2021-08-13  7:31 [PATCH 0/4] staging: r8188eu: refactor Hal_GetChnlGroup88E() Michael Straube
                   ` (2 preceding siblings ...)
  2021-08-13  7:31 ` [PATCH 3/4] staging: r8188eu: rename parameter of Hal_GetChnlGroup88E() Michael Straube
@ 2021-08-13  7:31 ` Michael Straube
  2021-08-14 17:13   ` Phillip Potter
  2021-08-13  9:44 ` [PATCH 0/4] staging: r8188eu: refactor Hal_GetChnlGroup88E() Martin Kaiser
  4 siblings, 1 reply; 13+ messages in thread
From: Michael Straube @ 2021-08-13  7:31 UTC (permalink / raw)
  To: gregkh
  Cc: Larry.Finger, phil, martin, linux-staging, linux-kernel, Michael Straube

Rename Hal_GetChnlGroup88E() to avoid camel case.
HalGetChnlGroup88E -> hal_get_chnl_group_88e

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
index 07ba5f0eecc2..24a82fc41872 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
@@ -2060,7 +2060,7 @@ static void Hal_ReadPowerValueFromPROM_8188E(struct txpowerinfo24g *pwrInfo24G,
 	}
 }
 
-static void Hal_GetChnlGroup88E(u8 chnl, u8 *group)
+static void hal_get_chnl_group_88e(u8 chnl, u8 *group)
 {
 	if (chnl < 3)			/*  Channel 1-2 */
 		*group = 0;
@@ -2114,7 +2114,7 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool Auto
 
 	for (rfPath = 0; rfPath < pHalData->NumTotalRFPath; rfPath++) {
 		for (ch = 0; ch < CHANNEL_MAX_NUMBER; ch++) {
-			Hal_GetChnlGroup88E(ch, &group);
+			hal_get_chnl_group_88e(ch, &group);
 
 			pHalData->Index24G_CCK_Base[rfPath][ch] = pwrInfo24G.IndexCCK_Base[rfPath][group];
 			if (ch == 14)
-- 
2.32.0


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

* Re: [PATCH 0/4] staging: r8188eu: refactor Hal_GetChnlGroup88E()
  2021-08-13  7:31 [PATCH 0/4] staging: r8188eu: refactor Hal_GetChnlGroup88E() Michael Straube
                   ` (3 preceding siblings ...)
  2021-08-13  7:31 ` [PATCH 4/4] staging: r8188eu: rename Hal_GetChnlGroup88E() Michael Straube
@ 2021-08-13  9:44 ` Martin Kaiser
  2021-08-14  6:30   ` Michael Straube
  4 siblings, 1 reply; 13+ messages in thread
From: Martin Kaiser @ 2021-08-13  9:44 UTC (permalink / raw)
  To: Michael Straube; +Cc: gregkh, Larry.Finger, phil, linux-staging, linux-kernel

Thus wrote Michael Straube (straube.linux@gmail.com):

> This series refactors Hal_GetChnlGroup88E().
>  - removes 5GHz code
>  - changes return type to void
>  - cleans up camel case naming

> Michael Straube (4):
>   staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E()
>   staging: r8188eu: convert return type of Hal_GetChnlGroup88E() to void
>   staging: r8188eu: rename parameter of Hal_GetChnlGroup88E()
>   staging: r8188eu: rename Hal_GetChnlGroup88E()

>  .../staging/r8188eu/hal/rtl8188e_hal_init.c   | 90 ++++++-------------
>  1 file changed, 26 insertions(+), 64 deletions(-)

> -- 
> 2.32.0

Hi Michael,

this series looks ok to me.

Acked-by: Martin Kaiser <martin@kaiser.cx>

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

* Re: [PATCH 1/4] staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E()
  2021-08-13  7:31 ` [PATCH 1/4] staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E() Michael Straube
@ 2021-08-13 16:27   ` Fabio M. De Francesco
  2021-08-13 18:25     ` Michael Straube
  2021-08-14 17:11   ` Phillip Potter
  1 sibling, 1 reply; 13+ messages in thread
From: Fabio M. De Francesco @ 2021-08-13 16:27 UTC (permalink / raw)
  To: gregkh, Michael Straube
  Cc: Larry.Finger, phil, martin, linux-staging, linux-kernel, Michael Straube

On Friday, August 13, 2021 9:31:06 AM CEST Michael Straube wrote:
> Remove 5GHz code from Hal_GetChnlGroup88E().
> 
> Signed-off-by: Michael Straube <straube.linux@gmail.com>
> ---
>  .../staging/r8188eu/hal/rtl8188e_hal_init.c   | 62 +++++--------------
>  1 file changed, 14 insertions(+), 48 deletions(-)

I missed those lines in my "Remove 5GHz band related code" series.
Nice work, so...

Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>

Thanks,

Fabio



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

* Re: [PATCH 1/4] staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E()
  2021-08-13 16:27   ` Fabio M. De Francesco
@ 2021-08-13 18:25     ` Michael Straube
  0 siblings, 0 replies; 13+ messages in thread
From: Michael Straube @ 2021-08-13 18:25 UTC (permalink / raw)
  To: Fabio M. De Francesco, gregkh
  Cc: Larry.Finger, phil, martin, linux-staging, linux-kernel

On 8/13/21 6:27 PM, Fabio M. De Francesco wrote:
> On Friday, August 13, 2021 9:31:06 AM CEST Michael Straube wrote:
>> Remove 5GHz code from Hal_GetChnlGroup88E().
>>
>> Signed-off-by: Michael Straube <straube.linux@gmail.com>
>> ---
>>   .../staging/r8188eu/hal/rtl8188e_hal_init.c   | 62 +++++--------------
>>   1 file changed, 14 insertions(+), 48 deletions(-)
> 
> I missed those lines in my "Remove 5GHz band related code" series.
> Nice work, so...
> 
> Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> 
> Thanks,
> 
> Fabio
> 
> 

Thanks for your review and ack Fabio. :)

Michael

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

* Re: [PATCH 0/4] staging: r8188eu: refactor Hal_GetChnlGroup88E()
  2021-08-13  9:44 ` [PATCH 0/4] staging: r8188eu: refactor Hal_GetChnlGroup88E() Martin Kaiser
@ 2021-08-14  6:30   ` Michael Straube
  0 siblings, 0 replies; 13+ messages in thread
From: Michael Straube @ 2021-08-14  6:30 UTC (permalink / raw)
  To: Martin Kaiser; +Cc: gregkh, Larry.Finger, phil, linux-staging, linux-kernel

On 8/13/21 11:44 AM, Martin Kaiser wrote:
> Thus wrote Michael Straube (straube.linux@gmail.com):
> 
>> This series refactors Hal_GetChnlGroup88E().
>>   - removes 5GHz code
>>   - changes return type to void
>>   - cleans up camel case naming
> 
>> Michael Straube (4):
>>    staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E()
>>    staging: r8188eu: convert return type of Hal_GetChnlGroup88E() to void
>>    staging: r8188eu: rename parameter of Hal_GetChnlGroup88E()
>>    staging: r8188eu: rename Hal_GetChnlGroup88E()
> 
>>   .../staging/r8188eu/hal/rtl8188e_hal_init.c   | 90 ++++++-------------
>>   1 file changed, 26 insertions(+), 64 deletions(-)
> 
>> -- 
>> 2.32.0
> 
> Hi Michael,
> 
> this series looks ok to me.
> 
> Acked-by: Martin Kaiser <martin@kaiser.cx>
> 

Hi Martin,

thank you.

Michael

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

* Re: [PATCH 1/4] staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E()
  2021-08-13  7:31 ` [PATCH 1/4] staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E() Michael Straube
  2021-08-13 16:27   ` Fabio M. De Francesco
@ 2021-08-14 17:11   ` Phillip Potter
  1 sibling, 0 replies; 13+ messages in thread
From: Phillip Potter @ 2021-08-14 17:11 UTC (permalink / raw)
  To: Michael Straube
  Cc: Greg KH, Larry Finger, Martin Kaiser, linux-staging,
	Linux Kernel Mailing List

On Fri, 13 Aug 2021 at 08:32, Michael Straube <straube.linux@gmail.com> wrote:
>
> Remove 5GHz code from Hal_GetChnlGroup88E().
>
> Signed-off-by: Michael Straube <straube.linux@gmail.com>
> ---
>  .../staging/r8188eu/hal/rtl8188e_hal_init.c   | 62 +++++--------------
>  1 file changed, 14 insertions(+), 48 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> index f0560c15387c..634a0a022727 100644
> --- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> +++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> @@ -2062,54 +2062,20 @@ static void Hal_ReadPowerValueFromPROM_8188E(struct txpowerinfo24g *pwrInfo24G,
>
>  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 {
> -               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;
> -       }
> -       return bIn24G;
> +       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 true;
>  }
>
>  void Hal_ReadPowerSavingMode88E(struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail)
> --
> 2.32.0
>

Dear Michael,

Looks good to me, thanks.

Acked-by: Phillip Potter <phil@philpotter.co.uk>

Regards,
Phil

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

* Re: [PATCH 2/4] staging: r8188eu: convert return type of Hal_GetChnlGroup88E() to void
  2021-08-13  7:31 ` [PATCH 2/4] staging: r8188eu: convert return type of Hal_GetChnlGroup88E() to void Michael Straube
@ 2021-08-14 17:12   ` Phillip Potter
  0 siblings, 0 replies; 13+ messages in thread
From: Phillip Potter @ 2021-08-14 17:12 UTC (permalink / raw)
  To: Michael Straube
  Cc: Greg KH, Larry Finger, Martin Kaiser, linux-staging,
	Linux Kernel Mailing List

On Fri, 13 Aug 2021 at 08:32, Michael Straube <straube.linux@gmail.com> wrote:
>
> After the removal of 5GHz code from Hal_GetChnlGroup88E() the function
> always returns true now. Convert the return type to void and change the
> only user Hal_ReadTxPowerInfo88E() accordingly.
>
> Signed-off-by: Michael Straube <straube.linux@gmail.com>
> ---
>  .../staging/r8188eu/hal/rtl8188e_hal_init.c   | 30 ++++++++-----------
>  1 file changed, 13 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> index 634a0a022727..d3345fa0eb60 100644
> --- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> +++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> @@ -2060,7 +2060,7 @@ static void Hal_ReadPowerValueFromPROM_8188E(struct txpowerinfo24g *pwrInfo24G,
>         }
>  }
>
> -static u8 Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup)
> +static void Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup)
>  {
>         if (chnl < 3)                   /*  Channel 1-2 */
>                 *pGroup = 0;
> @@ -2074,8 +2074,6 @@ static u8 Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup)
>                 *pGroup = 4;
>         else if (chnl == 14)            /*  Channel 14 */
>                 *pGroup = 5;
> -
> -       return true;
>  }
>
>  void Hal_ReadPowerSavingMode88E(struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail)
> @@ -2107,7 +2105,7 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool Auto
>         struct hal_data_8188e   *pHalData = GET_HAL_DATA(padapter);
>         struct txpowerinfo24g pwrInfo24G;
>         u8 rfPath, ch, group;
> -       u8 bIn24G, TxCount;
> +       u8 TxCount;
>
>         Hal_ReadPowerValueFromPROM_8188E(&pwrInfo24G, PROMContent, AutoLoadFail);
>
> @@ -2116,19 +2114,17 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool Auto
>
>         for (rfPath = 0; rfPath < pHalData->NumTotalRFPath; rfPath++) {
>                 for (ch = 0; ch < CHANNEL_MAX_NUMBER; ch++) {
> -                       bIn24G = Hal_GetChnlGroup88E(ch, &group);
> -                       if (bIn24G) {
> -                               pHalData->Index24G_CCK_Base[rfPath][ch] = pwrInfo24G.IndexCCK_Base[rfPath][group];
> -                               if (ch == 14)
> -                                       pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][4];
> -                               else
> -                                       pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][group];
> -                       }
> -                       if (bIn24G) {
> -                               DBG_88E("======= Path %d, Channel %d =======\n", rfPath, ch);
> -                               DBG_88E("Index24G_CCK_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_CCK_Base[rfPath][ch]);
> -                               DBG_88E("Index24G_BW40_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_BW40_Base[rfPath][ch]);
> -                       }
> +                       Hal_GetChnlGroup88E(ch, &group);
> +
> +                       pHalData->Index24G_CCK_Base[rfPath][ch] = pwrInfo24G.IndexCCK_Base[rfPath][group];
> +                       if (ch == 14)
> +                               pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][4];
> +                       else
> +                               pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][group];
> +
> +                       DBG_88E("======= Path %d, Channel %d =======\n", rfPath, ch);
> +                       DBG_88E("Index24G_CCK_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_CCK_Base[rfPath][ch]);
> +                       DBG_88E("Index24G_BW40_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_BW40_Base[rfPath][ch]);
>                 }
>                 for (TxCount = 0; TxCount < MAX_TX_COUNT; TxCount++) {
>                         pHalData->CCK_24G_Diff[rfPath][TxCount] = pwrInfo24G.CCK_Diff[rfPath][TxCount];
> --
> 2.32.0
>

Dear Michael,

Looks good to me, thanks.

Acked-by: Phillip Potter <phil@philpotter.co.uk>

Regards,
Phil

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

* Re: [PATCH 3/4] staging: r8188eu: rename parameter of Hal_GetChnlGroup88E()
  2021-08-13  7:31 ` [PATCH 3/4] staging: r8188eu: rename parameter of Hal_GetChnlGroup88E() Michael Straube
@ 2021-08-14 17:12   ` Phillip Potter
  0 siblings, 0 replies; 13+ messages in thread
From: Phillip Potter @ 2021-08-14 17:12 UTC (permalink / raw)
  To: Michael Straube
  Cc: Greg KH, Larry Finger, Martin Kaiser, linux-staging,
	Linux Kernel Mailing List

On Fri, 13 Aug 2021 at 08:32, Michael Straube <straube.linux@gmail.com> wrote:
>
> Rename parameter of Hal_GetChnlGroup88E() to avoid camel case.
> pGroup -> group
>
> Signed-off-by: Michael Straube <straube.linux@gmail.com>
> ---
>  drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> index d3345fa0eb60..07ba5f0eecc2 100644
> --- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> +++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> @@ -2060,20 +2060,20 @@ static void Hal_ReadPowerValueFromPROM_8188E(struct txpowerinfo24g *pwrInfo24G,
>         }
>  }
>
> -static void Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup)
> +static void Hal_GetChnlGroup88E(u8 chnl, u8 *group)
>  {
>         if (chnl < 3)                   /*  Channel 1-2 */
> -               *pGroup = 0;
> +               *group = 0;
>         else if (chnl < 6)              /*  Channel 3-5 */
> -               *pGroup = 1;
> +               *group = 1;
>         else if (chnl < 9)              /*  Channel 6-8 */
> -               *pGroup = 2;
> +               *group = 2;
>         else if (chnl < 12)             /*  Channel 9-11 */
> -               *pGroup = 3;
> +               *group = 3;
>         else if (chnl < 14)             /*  Channel 12-13 */
> -               *pGroup = 4;
> +               *group = 4;
>         else if (chnl == 14)            /*  Channel 14 */
> -               *pGroup = 5;
> +               *group = 5;
>  }
>
>  void Hal_ReadPowerSavingMode88E(struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail)
> --
> 2.32.0
>

Dear Michael,

Looks good to me, thanks.

Acked-by: Phillip Potter <phil@philpotter.co.uk>

Regards,
Phil

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

* Re: [PATCH 4/4] staging: r8188eu: rename Hal_GetChnlGroup88E()
  2021-08-13  7:31 ` [PATCH 4/4] staging: r8188eu: rename Hal_GetChnlGroup88E() Michael Straube
@ 2021-08-14 17:13   ` Phillip Potter
  0 siblings, 0 replies; 13+ messages in thread
From: Phillip Potter @ 2021-08-14 17:13 UTC (permalink / raw)
  To: Michael Straube
  Cc: Greg KH, Larry Finger, Martin Kaiser, linux-staging,
	Linux Kernel Mailing List

On Fri, 13 Aug 2021 at 08:32, Michael Straube <straube.linux@gmail.com> wrote:
>
> Rename Hal_GetChnlGroup88E() to avoid camel case.
> HalGetChnlGroup88E -> hal_get_chnl_group_88e
>
> Signed-off-by: Michael Straube <straube.linux@gmail.com>
> ---
>  drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> index 07ba5f0eecc2..24a82fc41872 100644
> --- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> +++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> @@ -2060,7 +2060,7 @@ static void Hal_ReadPowerValueFromPROM_8188E(struct txpowerinfo24g *pwrInfo24G,
>         }
>  }
>
> -static void Hal_GetChnlGroup88E(u8 chnl, u8 *group)
> +static void hal_get_chnl_group_88e(u8 chnl, u8 *group)
>  {
>         if (chnl < 3)                   /*  Channel 1-2 */
>                 *group = 0;
> @@ -2114,7 +2114,7 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool Auto
>
>         for (rfPath = 0; rfPath < pHalData->NumTotalRFPath; rfPath++) {
>                 for (ch = 0; ch < CHANNEL_MAX_NUMBER; ch++) {
> -                       Hal_GetChnlGroup88E(ch, &group);
> +                       hal_get_chnl_group_88e(ch, &group);
>
>                         pHalData->Index24G_CCK_Base[rfPath][ch] = pwrInfo24G.IndexCCK_Base[rfPath][group];
>                         if (ch == 14)
> --
> 2.32.0
>

Dear Michael,

Looks good to me, thanks.

Acked-by: Phillip Potter <phil@philpotter.co.uk>

Regards,
Phil

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

end of thread, other threads:[~2021-08-14 17:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-13  7:31 [PATCH 0/4] staging: r8188eu: refactor Hal_GetChnlGroup88E() Michael Straube
2021-08-13  7:31 ` [PATCH 1/4] staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E() Michael Straube
2021-08-13 16:27   ` Fabio M. De Francesco
2021-08-13 18:25     ` Michael Straube
2021-08-14 17:11   ` Phillip Potter
2021-08-13  7:31 ` [PATCH 2/4] staging: r8188eu: convert return type of Hal_GetChnlGroup88E() to void Michael Straube
2021-08-14 17:12   ` Phillip Potter
2021-08-13  7:31 ` [PATCH 3/4] staging: r8188eu: rename parameter of Hal_GetChnlGroup88E() Michael Straube
2021-08-14 17:12   ` Phillip Potter
2021-08-13  7:31 ` [PATCH 4/4] staging: r8188eu: rename Hal_GetChnlGroup88E() Michael Straube
2021-08-14 17:13   ` Phillip Potter
2021-08-13  9:44 ` [PATCH 0/4] staging: r8188eu: refactor Hal_GetChnlGroup88E() Martin Kaiser
2021-08-14  6:30   ` Michael Straube

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).