[PATCH 28/61] staging: rtl8723bs: inline single-use _clear_cam_entry helper

From: Arsenii Pashchenko

Date: Wed Jul 15 2026 - 08:55:43 EST


Remove the _clear_cam_entry() helper function since it has only a
single call site across the driver.

Inline its logic directly into the sole invocation site and modernize
the array declarations. Replace the verbose 'unsigned char' types with
the standard kernel 'u8' type, and swap the explicit hexadecimal zero
sequences for clean, fixed-size bounds with zero-initializers ({0}).

This eliminates an unnecessary abstraction layer, reduces visual noise,
and cleans up the driver's CAM management path.

Signed-off-by: Arsenii Pashchenko <ulijg308@xxxxxxxxx>
---
drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 13 ++++---------
drivers/staging/rtl8723bs/include/rtw_mlme_ext.h | 1 -
2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index 053861f29..c85055687 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -423,14 +423,6 @@ void _write_cam(struct adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key)
}
}

-void _clear_cam_entry(struct adapter *padapter, u8 entry)
-{
- unsigned char null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
- unsigned char null_key[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-
- _write_cam(padapter, entry, 0, null_sta, null_key);
-}
-
inline void write_cam(struct adapter *adapter, u8 id, u16 ctrl, u8 *mac, u8 *key)
{
_write_cam(adapter, id, ctrl, mac, key);
@@ -439,7 +431,10 @@ inline void write_cam(struct adapter *adapter, u8 id, u16 ctrl, u8 *mac, u8 *key

inline void clear_cam_entry(struct adapter *adapter, u8 id)
{
- _clear_cam_entry(adapter, id);
+ u8 null_sta[6] = {0};
+ u8 null_key[16] = {0};
+
+ _write_cam(adapter, id, 0, null_sta, null_key);
clear_cam_cache(adapter, id);
}

diff --git a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
index 4b05779f2..2b8df2bdb 100644
--- a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
@@ -449,7 +449,6 @@ unsigned int decide_wait_for_beacon_timeout(unsigned int bcn_interval);

/* modify HW only */
void _write_cam(struct adapter *padapter, u8 entry, u16 ctrl, u8 *mac, u8 *key);
-void _clear_cam_entry(struct adapter *padapter, u8 entry);

/* modify both HW and cache */
void write_cam(struct adapter *padapter, u8 id, u16 ctrl, u8 *mac, u8 *key);
--
2.55.0