[PATCH 30/61] staging: rtl8723bs: replace correct_TSF with direct HAL call
From: Arsenii Pashchenko
Date: Wed Jul 15 2026 - 08:55:33 EST
Remove the redundant correct_TSF() wrapper function from rtw_wlan_util.c
and replace its call sites with direct calls to rtw_hal_set_hwreg().
The helper provides no extra logic or validation, serving only to pass
the fixed HW_VAR_CORRECT_TSF flag and a NULL pointer to the underlying
HAL layer. Removing it simplifies the driver's synchronization
interface and reduces call overhead.
Clean up the function definition, remove its prototype from the header
file, and update all invocations across the driver.
Signed-off-by: Arsenii Pashchenko <ulijg308@xxxxxxxxx>
---
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 4 ++--
drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 5 -----
drivers/staging/rtl8723bs/include/rtw_mlme_ext.h | 1 -
3 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index d472570db..9dfa31171 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -4690,7 +4690,7 @@ void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res)
if ((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) {
/* correcting TSF */
- correct_TSF(padapter, pmlmeext);
+ rtw_hal_set_hwreg(padapter, HW_VAR_CORRECT_TSF, NULL);
/* set_link_timer(pmlmeext, DISCONNECT_TO); */
}
@@ -4714,7 +4714,7 @@ void mlmeext_sta_add_event_callback(struct adapter *padapter, struct sta_info *p
/* update_TSF(pmlmeext, pframe, len); */
/* correcting TSF */
- correct_TSF(padapter, pmlmeext);
+ rtw_hal_set_hwreg(padapter, HW_VAR_CORRECT_TSF, NULL);
/* start beacon */
if (send_beacon(padapter) == _FAIL) {
diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index dc2e341aa..03e047397 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -1600,11 +1600,6 @@ void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
pmlmeext->TSFValue |= le32_to_cpu(*pbuf);
}
-void correct_TSF(struct adapter *padapter, struct mlme_ext_priv *pmlmeext)
-{
- rtw_hal_set_hwreg(padapter, HW_VAR_CORRECT_TSF, NULL);
-}
-
void adaptive_early_32k(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
{
int i;
diff --git a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
index 6b1ac26b3..b12128963 100644
--- a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
@@ -602,7 +602,6 @@ void sa_query_timer_hdl(struct timer_list *t);
extern void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr);
extern void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len);
-extern void correct_TSF(struct adapter *padapter, struct mlme_ext_priv *pmlmeext);
extern void adaptive_early_32k(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len);
extern bool traffic_status_watchdog(struct adapter *padapter, bool from_timer);
--
2.55.0