[PATCH 27/61] staging: rtl8723bs: replace rtw_set_oper_bw with direct assignment
From: Arsenii Pashchenko
Date: Wed Jul 15 2026 - 08:55:07 EST
Remove the redundant rtw_set_oper_bw() wrapper function from
rtw_wlan_util.c and replace its call sites with direct structure
member assignments.
The helper provides no extra logic, locking, or validation, acting
solely as a setter for adapter_to_dvobj(adapter)->oper_bwmode.
Removing it reduces unnecessary abstraction layers and simplifies the
driver interface.
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_wlan_util.c | 14 ++------------
drivers/staging/rtl8723bs/include/rtw_mlme_ext.h | 2 --
2 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index f610fa5b3..053861f29 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -260,16 +260,6 @@ inline void rtw_set_oper_ch(struct adapter *adapter, u8 ch)
dvobj->oper_channel = ch;
}
-inline void rtw_set_oper_bw(struct adapter *adapter, u8 bw)
-{
- adapter_to_dvobj(adapter)->oper_bwmode = bw;
-}
-
-inline void rtw_set_oper_choffset(struct adapter *adapter, u8 offset)
-{
- adapter_to_dvobj(adapter)->oper_ch_offset = offset;
-}
-
u8 rtw_get_center_ch(u8 channel, u8 chnl_bw, u8 chnl_offset)
{
u8 center_ch = channel;
@@ -317,8 +307,8 @@ void set_channel_bwmode(struct adapter *padapter, unsigned char channel, unsigne
/* saved channel/bw info */
rtw_set_oper_ch(padapter, channel);
- rtw_set_oper_bw(padapter, bwmode);
- rtw_set_oper_choffset(padapter, channel_offset);
+ adapter_to_dvobj(padapter)->oper_bwmode = bwmode;
+ adapter_to_dvobj(padapter)->oper_ch_offset = channel_offset;
rtw_hal_set_chnl_bw(padapter, center_ch, bwmode, channel_offset, chnl_offset80); /* set center channel */
diff --git a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
index ae4c4586f..4b05779f2 100644
--- a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
@@ -439,8 +439,6 @@ void Switch_DM_Func(struct adapter *padapter, u32 mode, u8 enable);
void set_msr(struct adapter *padapter, u8 type);
void rtw_set_oper_ch(struct adapter *adapter, u8 ch);
-void rtw_set_oper_bw(struct adapter *adapter, u8 bw);
-void rtw_set_oper_choffset(struct adapter *adapter, u8 offset);
u8 rtw_get_center_ch(u8 channel, u8 chnl_bw, u8 chnl_offset);
unsigned long rtw_get_on_cur_ch_time(struct adapter *adapter);
--
2.55.0