[PATCH] staging: rtl8723bs: remove dead 5GHz fallback in GetDeltaSwingTable_8723B
From: Hank Yang <hidden>
Date: 2026-09-06 04:22:01
Subsystem:
staging subsystem, the rest · Maintainers:
Greg Kroah-Hartman, Linus Torvalds
GetDeltaSwingTable_8723B() falls back to calibration tables from a
different chip (8188E) when `channel` is outside the range of 1 to 14:
} else {
*TemperatureUP_A = (u8 *)DeltaSwingTableIdx_2GA_P_8188E;
...
}
This branch is unreachable. `channel` comes from `CurrentChannel`,
which is only updated in rtl8723b_phycfg.c after passing
HAL_IsLegalChannel(), which enforces a range of 1 to 14. Since
RTL8723BS is a 2.4GHz-only chip [1][2], with no 5GHz support,
`CurrentChannel` can never exceed the range of 1 to 14, so this
fallback branch can never execute.
See discussion at [3] for the full reasoning.
Also remove the two DeltaSwingTableIdx_*_8188E arrays that were
only used by this branch, along with a comment referencing a
TxPowerTrack.txt config file — no such file-reading logic exists
anywhere in this driver, so the comment is stale as well.
[1] https://www.realtek.com/Product/Index?id=610&cate_id=194
[2] https://fccid.io/TX2-RTL8723BS/User-Manual/User-Manual-System-pdf-2365682
[3] https://lore.kernel.org/linux-staging/2026090527-outdoors-press-9602@gregkh/T/#t (local)
Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Hank Yang <redacted>
---
.../staging/rtl8723bs/hal/HalPhyRf_8723B.c | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
index 6c5f56d5a1f4..394ee4e732a6 100644
--- a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
+++ b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c@@ -21,20 +21,6 @@ #define PATH_S1 0 /* RF_PATH_A */ #define IDX_0xC4C 2 -/*---------------------------Define Local Constant---------------------------*/ - -/* In the case that we fail to read TxPowerTrack.txt, we use the table for - * 88E as the default table. - */ -static u8 DeltaSwingTableIdx_2GA_N_8188E[] = { - 0, 0, 0, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, - 7, 7, 7, 7, 8, 8, 9, 9, 10, 10, 10, 11, 11, 11, 11 -}; -static u8 DeltaSwingTableIdx_2GA_P_8188E[] = { - 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 4, - 4, 4, 4, 5, 5, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9 -}; - /* 3 ============================================================ */ /* 3 Tx Power Tracking */ /* 3 ============================================================ */
@@ -312,11 +298,6 @@ static void GetDeltaSwingTable_8723B( *TemperatureUP_B = pRFCalibrateInfo->DeltaSwingTableIdx_2GB_P; *TemperatureDOWN_B = pRFCalibrateInfo->DeltaSwingTableIdx_2GB_N; } - } else { - *TemperatureUP_A = (u8 *)DeltaSwingTableIdx_2GA_P_8188E; - *TemperatureDOWN_A = (u8 *)DeltaSwingTableIdx_2GA_N_8188E; - *TemperatureUP_B = (u8 *)DeltaSwingTableIdx_2GA_P_8188E; - *TemperatureDOWN_B = (u8 *)DeltaSwingTableIdx_2GA_N_8188E; } }
--
2.43.0