From: Yaroslav Shevchenko <yros22776@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH] staging: rtl8723bs: remove unused macros from wifi.h
Date: Wed, 21 Oct 2026 22:46:33 +0200 [thread overview]
Message-ID: <20261021204633.33067-1-yros22776@gmail.com> (raw)
SetFrameType(), SetFragNum(), GetOrderBit(), ACT_CAT_VENDOR,
_IEEE8021X_MGT_ and _IEEE8021X_PSK_ are defined in wifi.h but have no
users anywhere in the tree.
Three of them are also broken. GetOrderBit() duplicates GetOrder(),
which is used by rtw_recv.c, but casts the frame header to
"unsigned short" instead of __le16 while masking it against a
cpu_to_le16() value. SetFrameType() has the same type confusion,
whereas the SetFrameSubType() macro next to it casts to __le16 as it
should. SetFragNum() passes a constant mask through le16_to_cpu()
where cpu_to_le16() is needed.
Since these macros are never expanded, neither the compiler nor sparse
flags any of this, so the first user of them would inherit the bugs.
Drop them rather than fix dead code.
No functional change intended. Built for arm64 with W=1, no new
warnings.
Signed-off-by: Yaroslav Shevchenko <yros22776@gmail.com>
Assisted-by: LLM
---
drivers/staging/rtl8723bs/include/wifi.h | 20 --------------------
1 file changed, 20 deletions(-)
diff --git a/drivers/staging/rtl8723bs/include/wifi.h b/drivers/staging/rtl8723bs/include/wifi.h
index 93cb83488..719a1ea34 100644
--- a/drivers/staging/rtl8723bs/include/wifi.h
+++ b/drivers/staging/rtl8723bs/include/wifi.h
@@ -123,12 +123,6 @@ enum {
#define GetFrameType(pbuf) \
(le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(3) | BIT(2)))
-#define SetFrameType(pbuf, type) \
- do { \
- *(unsigned short *)(pbuf) &= cpu_to_le16(~(BIT(3) | BIT(2))); \
- *(unsigned short *)(pbuf) |= cpu_to_le16(type); \
- } while (0)
-
#define GetFrameSubType(pbuf) (le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(7) |\
BIT(6) | BIT(5) | BIT(4) | BIT(3) | BIT(2)))
@@ -145,14 +139,6 @@ enum {
#define GetFragNum(pbuf) \
(le16_to_cpu(*(__le16 *)((size_t)(pbuf) + 22)) & 0x0f)
-#define SetFragNum(pbuf, num) \
- do { \
- *(unsigned short *)((size_t)(pbuf) + 22) = \
- ((*(unsigned short *)((size_t)(pbuf) + 22)) & \
- le16_to_cpu(~(0x000f))) | \
- cpu_to_le16(0x0f & (num)); \
- } while (0)
-
#define SetSeqNum(pbuf, num) \
do { \
*(__le16 *)((size_t)(pbuf) + 22) = \
@@ -306,9 +292,6 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
/*-----------------------------------------------------------------------------
Below is the definition for 802.11i / 802.1x
------------------------------------------------------------------------------*/
-#define _IEEE8021X_MGT_ 1 /* WPA */
-#define _IEEE8021X_PSK_ 2 /* WPA with pre-shared key */
-
#define _MME_IE_LENGTH_ 18
/*-----------------------------------------------------------------------------
Below is the definition for WMM
@@ -318,9 +301,6 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
/*-----------------------------------------------------------------------------
Below is the definition for 802.11n
------------------------------------------------------------------------------*/
-#define GetOrderBit(pbuf) (((*(unsigned short *)(pbuf)) & cpu_to_le16(_ORDER_)) != 0)
-
-#define ACT_CAT_VENDOR 0x7F/* 127 */
/**
* struct rtw_ieee80211_ht_cap - HT additional information
--
2.47.3
reply other threads:[~2026-10-21 20:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261021204633.33067-1-yros22776@gmail.com \
--to=yros22776@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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®