summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorFabio Aiuto <fabioaiuto83@gmail.com>2021-07-21 15:37:08 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-23 13:09:44 +0200
commit2d4c39b32361a7044eed1906e9a6d42ac1ebfabc (patch)
tree90ced0d97668f65d0b58ef3ae41e2fe0e15b0c4e /drivers
parent9bd9e0de1cf5b89c4854be505ac0a418ddcc01bf (diff)
staging: rtl8723bs: simplify function selecting channel group
simplify function Hal_GetChnlGroup8723B(). It returns an unused and unnecessary bool value telling which band the device works on. Since we work only on 2.4Ghz band and the useful return value is the second function argument we convert the return type to void. remove 5Ghz dead code either (for channel > 14). Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/a5536788004c44fe819c0eab0d19504824af46cd.1626874164.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c62
1 files changed, 12 insertions, 50 deletions
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index 059d3050acc6..bd0e9f05eb5c 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -2061,56 +2061,18 @@ s32 rtl8723b_InitLLTTable(struct adapter *padapter)
return ret;
}
-static bool Hal_GetChnlGroup8723B(u8 Channel, u8 *pGroup)
-{
- bool bIn24G = true;
-
- if (Channel <= 14) {
- bIn24G = true;
-
- if (1 <= Channel && Channel <= 2)
- *pGroup = 0;
- else if (3 <= Channel && Channel <= 5)
- *pGroup = 1;
- else if (6 <= Channel && Channel <= 8)
- *pGroup = 2;
- else if (9 <= Channel && Channel <= 11)
- *pGroup = 3;
- else if (12 <= Channel && Channel <= 14)
- *pGroup = 4;
- } else {
- bIn24G = false;
-
- if (36 <= Channel && Channel <= 42)
- *pGroup = 0;
- else if (44 <= Channel && Channel <= 48)
- *pGroup = 1;
- else if (50 <= Channel && Channel <= 58)
- *pGroup = 2;
- else if (60 <= Channel && Channel <= 64)
- *pGroup = 3;
- else if (100 <= Channel && Channel <= 106)
- *pGroup = 4;
- else if (108 <= Channel && Channel <= 114)
- *pGroup = 5;
- else if (116 <= Channel && Channel <= 122)
- *pGroup = 6;
- else if (124 <= Channel && Channel <= 130)
- *pGroup = 7;
- else if (132 <= Channel && Channel <= 138)
- *pGroup = 8;
- else if (140 <= Channel && Channel <= 144)
- *pGroup = 9;
- else if (149 <= Channel && Channel <= 155)
- *pGroup = 10;
- else if (157 <= Channel && Channel <= 161)
- *pGroup = 11;
- else if (165 <= Channel && Channel <= 171)
- *pGroup = 12;
- else if (173 <= Channel && Channel <= 177)
- *pGroup = 13;
- }
- return bIn24G;
+static void Hal_GetChnlGroup8723B(u8 Channel, u8 *pGroup)
+{
+ if (1 <= Channel && Channel <= 2)
+ *pGroup = 0;
+ else if (3 <= Channel && Channel <= 5)
+ *pGroup = 1;
+ else if (6 <= Channel && Channel <= 8)
+ *pGroup = 2;
+ else if (9 <= Channel && Channel <= 11)
+ *pGroup = 3;
+ else if (12 <= Channel && Channel <= 14)
+ *pGroup = 4;
}
void Hal_InitPGData(struct adapter *padapter, u8 *PROMContent)