[PATCH 1/3] staging: rtl8723bs: convert rate and mode check macros to inline
From: Albu Victor-Marian
Date: Mon Oct 26 2026 - 16:58:50 EST
Convert IS_HT_RATE(), IS_CCK_RATE(), IS_OFDM_RATE() and is_legacy_only()
to static inline functions.
No functional change intended.
Compile tested only.
Signed-off-by: Albu Victor-Marian <albu.victor.m@xxxxxxxxx>
---
drivers/staging/rtl8723bs/include/ieee80211.h | 21 +++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
index 9767013887af..9741daef3b87 100644
--- a/drivers/staging/rtl8723bs/include/ieee80211.h
+++ b/drivers/staging/rtl8723bs/include/ieee80211.h
@@ -152,7 +152,10 @@ enum network_type {
#define SUPPORTED_24G_NETTYPE_MSK (WIRELESS_11B | WIRELESS_11G | WIRELESS_11_24N)
-#define is_legacy_only(net_type) ((net_type) == ((net_type) & (WIRELESS_11BG)))
+static inline bool is_legacy_only(uint net_type)
+{
+ return net_type == (net_type & WIRELESS_11BG);
+}
#define is_supported_24g(net_type) ((net_type) & SUPPORTED_24G_NETTYPE_MSK ? true : false)
@@ -392,10 +395,20 @@ enum {
MGN_UNKNOWN
};
-#define IS_HT_RATE(_rate) (_rate >= MGN_MCS0 && _rate <= MGN_MCS31)
-#define IS_CCK_RATE(_rate) (_rate == MGN_1M || _rate == MGN_2M || _rate == MGN_5_5M || _rate == MGN_11M)
-#define IS_OFDM_RATE(_rate) (_rate >= MGN_6M && _rate <= MGN_54M && _rate != MGN_11M)
+static inline bool IS_HT_RATE(uint rate)
+{
+ return rate >= MGN_MCS0 && rate <= MGN_MCS7;
+}
+static inline bool IS_CCK_RATE(uint rate)
+{
+ return rate == MGN_1M || rate == MGN_2M || rate == MGN_5_5M || rate == MGN_11M;
+}
+
+static inline bool IS_OFDM_RATE(uint rate)
+{
+ return rate >= MGN_6M && rate <= MGN_54M && rate != MGN_11M;
+}
/* NOTE: This data is for statistical purposes; not all hardware provides this
* information for frames received. Not setting these will not cause
--
2.43.0