mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Albu Victor-Marian <albu.victor.m@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Yalagada Pavan Kumar <pavankumaryalagada@gmail.com>,
	Albu Victor-Marian <albu.victor.m@gmail.com>
Subject: [PATCH 1/3] staging: rtl8723bs: convert rate and mode check macros to inline
Date: Mon, 26 Oct 2026 22:56:57 +0200	[thread overview]
Message-ID: <20261026205659.181065-2-albu.victor.m@gmail.com> (raw)
In-Reply-To: <20261026205659.181065-1-albu.victor.m@gmail.com>

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@gmail.com>
---
 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


  reply	other threads:[~2026-10-26 20:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26 20:56 [PATCH 0/3] staging: rtl8723bs: checkpatch cleanup in ieee80211 files Albu Victor-Marian
2026-10-26 20:56 ` Albu Victor-Marian [this message]
2026-10-26 20:56 ` [PATCH 2/3] staging: rtl8723bs: use BIT() macro for bit definitions Albu Victor-Marian
2026-10-26 20:56 ` [PATCH 3/3] staging: rtl8723bs: fix spacing and line length in ieee80211 files Albu Victor-Marian
2026-10-27  5:34 ` [PATCH 0/3] staging: rtl8723bs: checkpatch cleanup " Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261026205659.181065-2-albu.victor.m@gmail.com \
    --to=albu.victor.m@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=pavankumaryalagada@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®