staging: r8188eu: refactor Hal_GetChnlGroup88E()
cover staging: r8188eu: refactor Hal_GetChnlGroup88E()
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(-)
Signature · 1 line
2.32.0
PATCH 1/4 staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E()
Remove 5GHz code from Hal_GetChnlGroup88E().
--- .../staging/r8188eu/hal/rtl8188e_hal_init.c | 62 +++++-------------- 1 file changed, 14 insertions(+), 48 deletions(-)
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +14 -48
@@ -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)
Signature · 1 line
2.32.0
PATCH 2/4 staging: r8188eu: convert return type of Hal_GetChnlGroup88E() to void
In reply to Michael StraubeAfter 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.
--- .../staging/r8188eu/hal/rtl8188e_hal_init.c | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-)
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +13 -17
@@ -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 Autostruct 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 Autofor (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];
Signature · 1 line
2.32.0
PATCH 3/4 staging: r8188eu: rename parameter of Hal_GetChnlGroup88E()
In reply to Michael StraubeRename parameter of Hal_GetChnlGroup88E() to avoid camel case. pGroup -> group
--- drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +7 -7
@@ -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)
Signature · 1 line
2.32.0
PATCH 4/4 staging: r8188eu: rename Hal_GetChnlGroup88E()
In reply to Michael StraubeRename Hal_GetChnlGroup88E() to avoid camel case.
HalGetChnlGroup88E -> hal_get_chnl_group_88e
--- drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +2 -2
@@ -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 Autofor (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 )
Signature · 1 line
2.32.0
Thus wrote Michael Straube ([email protected]):
Quoted 5 lines
This series refactors
Hal_GetChnlGroup88E().
- removes 5GHz code
- changes return type to void
- cleans up camel case naming
Quoted 11 lines
Michael Straube (4):
staging: r8188eu: remove 5GHz code fromHal_GetChnlGroup88E()
staging: r8188eu: convert return type ofHal_GetChnlGroup88E()to void
staging: r8188eu: rename parameter ofHal_GetChnlGroup88E()
staging: r8188eu: renameHal_GetChnlGroup88E().../staging/r8188eu/hal/rtl8188e_hal_init.c | 90 ++++++------------- 1 file changed, 26 insertions(+), 64 deletions(-)Signature · 1 line
2.32.0
Hi Michael,
this series looks ok to me.
Re: [PATCH 1/4] staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E()
In reply to Michael StraubeQuoted 6 lines · CEST Michael Straube
Remove 5GHz code from
Hal_GetChnlGroup88E().Signed-off-by Michael Straube <[email protected]>--- .../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...
Thanks,
Fabio
Re: [PATCH 1/4] staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E()
Quoted 8 lines · Fabio M. De Francesco
Quoted 6 lines · CEST Michael Straube
Remove 5GHz code from
Hal_GetChnlGroup88E().Signed-off-by Michael Straube <[email protected]>--- .../staging/r8188eu/hal/rtl8188e_hal_init.c | 62 +++++-------------- 1 file changed, 14 insertions(+), 48 deletions(-)
Quoted 10 lines
I missed those lines in my "Remove 5GHz band related code" series. Nice work, so...
Thanks,
Fabio
Thanks for your review and ack Fabio. :)
Michael
Quoted 16 lines · Martin Kaiser
Thus wrote Michael Straube ([email protected]):
Quoted 13 lines
This series refactors
Hal_GetChnlGroup88E().
- removes 5GHz code
- changes return type to void
- cleans up camel case namingMichael Straube (4):
staging: r8188eu: remove 5GHz code fromHal_GetChnlGroup88E()
staging: r8188eu: convert return type ofHal_GetChnlGroup88E()to void
staging: r8188eu: rename parameter ofHal_GetChnlGroup88E()
staging: r8188eu: renameHal_GetChnlGroup88E().../staging/r8188eu/hal/rtl8188e_hal_init.c | 90 ++++++------------- 1 file changed, 26 insertions(+), 64 deletions(-)
Quoted 9 lines
Quoted 2 lines
Signature · 1 line
2.32.0Hi Michael,
this series looks ok to me.
Acked-by Martin Kaiser <[email protected]>
Hi Martin,
thank you.
Michael
Re: [PATCH 1/4] staging: r8188eu: remove 5GHz code from Hal_GetChnlGroup88E()
In reply to Michael StraubeQuoted 82 lines · Michael Straube
Remove 5GHz code from
Hal_GetChnlGroup88E().Signed-off-by Michael Straube <[email protected]>--- .../staging/r8188eu/hal/rtl8188e_hal_init.c | 62 +++++-------------- 1 file changed, 14 insertions(+), 48 deletions(-)drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +14
-49@@ -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) --
Quoted 2 lines
2.32.0
Dear Michael,
Looks good to me, thanks.
Regards,
Phil
Re: [PATCH 2/4] staging: r8188eu: convert return type of Hal_GetChnlGroup88E() to void
In reply to Michael StraubeQuoted 73 lines · 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 userHal_ReadTxPowerInfo88E()accordingly.Signed-off-by Michael Straube <[email protected]>--- .../staging/r8188eu/hal/rtl8188e_hal_init.c | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-)drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +13
-18@@ -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 Autostruct 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 Autofor (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]; --
Quoted 2 lines
2.32.0
Dear Michael,
Looks good to me, thanks.
Regards,
Phil
Re: [PATCH 3/4] staging: r8188eu: rename parameter of Hal_GetChnlGroup88E()
In reply to Michael StraubeQuoted 42 lines · Michael Straube
Rename parameter of
Hal_GetChnlGroup88E()to avoid camel case. pGroup -> groupSigned-off-by Michael Straube <[email protected]>--- drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +7
-8@@ -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) --
Quoted 2 lines
2.32.0
Dear Michael,
Looks good to me, thanks.
Regards,
Phil
Re: [PATCH 4/4] staging: r8188eu: rename Hal_GetChnlGroup88E()
In reply to Michael StraubeQuoted 32 lines · Michael Straube
Rename
Hal_GetChnlGroup88E()to avoid camel case.
HalGetChnlGroup88E ->hal_get_chnl_group_88eSigned-off-by Michael Straube <[email protected]>--- drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +2
-3@@ -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 Autofor (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 ) --
Quoted 2 lines
2.32.0
Dear Michael,
Looks good to me, thanks.
Regards,
Phil