From: deep@crimson.net.eu.org
To: error27@gmail.com
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org,
Kenet Jovan Sokoli <deep@crimson.net.eu.org>
Subject: [PATCH v3] staging: rtl8723bs: remove unused struct rtw_regulatory
Date: Tue, 14 Apr 2026 10:13:25 +0200 [thread overview]
Message-ID: <20260414081325.142313-1-deep@crimson.net.eu.org> (raw)
From: Kenet Jovan Sokoli <deep@crimson.net.eu.org>
The struct rtw_regulatory is never used in the rtl8723bs driver.
Functions taking it as a parameter are always passed NULL and
perform no logic with it. Remove the dead code and the struct.
Suggested-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Kenet Jovan Sokoli <deep@crimson.net.eu.org>
---
v3: Rewrote the whitespace as it was, my bad for changing it
to begin with.
v2: Completely refactored the logic to remove the functions
and the struct entirely as suggested by Dan Carpenter. I am
still learning the ropes with Git, so I messed up on how to
perform a proper cleanup!
---
drivers/staging/rtl8723bs/include/wifi.h | 11 -----------
drivers/staging/rtl8723bs/os_dep/wifi_regd.c | 18 ++++++------------
2 files changed, 6 insertions(+), 23 deletions(-)
diff --git a/drivers/staging/rtl8723bs/include/wifi.h b/drivers/staging/rtl8723bs/include/wifi.h
index 230b2c4ffd3b..592fa66341b4 100644
--- a/drivers/staging/rtl8723bs/include/wifi.h
+++ b/drivers/staging/rtl8723bs/include/wifi.h
@@ -450,15 +450,4 @@ struct regd_pair_mapping {
u16 reg_2ghz_ctl;
};
-struct rtw_regulatory {
- char alpha2[2];
- u16 country_code;
- u16 max_power_level;
- u32 tp_scale;
- u16 current_rd;
- u16 current_rd_ext;
- int16_t power_limit;
- struct regd_pair_mapping *regpair;
-};
-
#endif /* _WIFI_H_ */
diff --git a/drivers/staging/rtl8723bs/os_dep/wifi_regd.c b/drivers/staging/rtl8723bs/os_dep/wifi_regd.c
index f9c4d487badf..c48a1e3ba4ac 100644
--- a/drivers/staging/rtl8723bs/os_dep/wifi_regd.c
+++ b/drivers/staging/rtl8723bs/os_dep/wifi_regd.c
@@ -83,23 +83,19 @@ static void _rtw_reg_apply_flags(struct wiphy *wiphy)
}
static int _rtw_reg_notifier_apply(struct wiphy *wiphy,
- struct regulatory_request *request,
- struct rtw_regulatory *reg)
+ struct regulatory_request *request)
{
/* Hard code flags */
_rtw_reg_apply_flags(wiphy);
return 0;
}
-static const struct ieee80211_regdomain *_rtw_regdomain_select(struct
- rtw_regulatory
- *reg)
+static const struct ieee80211_regdomain *_rtw_regdomain_select(void)
{
return &rtw_regdom_rd;
}
-static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg,
- struct wiphy *wiphy,
+static void _rtw_regd_init_wiphy(struct wiphy *wiphy,
void (*reg_notifier)(struct wiphy *wiphy,
struct
regulatory_request *
@@ -113,7 +109,7 @@ static void _rtw_regd_init_wiphy(struct rtw_regulatory *reg,
wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG;
wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS;
- regd = _rtw_regdomain_select(reg);
+ regd = _rtw_regdomain_select();
wiphy_apply_custom_regulatory(wiphy, regd);
/* Hard code flags */
@@ -124,12 +120,10 @@ void rtw_regd_init(struct wiphy *wiphy,
void (*reg_notifier)(struct wiphy *wiphy,
struct regulatory_request *request))
{
- _rtw_regd_init_wiphy(NULL, wiphy, reg_notifier);
+ _rtw_regd_init_wiphy(wiphy, reg_notifier);
}
void rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
{
- struct rtw_regulatory *reg = NULL;
-
- _rtw_reg_notifier_apply(wiphy, request, reg);
+ _rtw_reg_notifier_apply(wiphy, request);
}
--
2.43.0
next reply other threads:[~2026-04-14 8:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-14 8:13 deep [this message]
2026-04-14 8:30 ` [PATCH v3] staging: rtl8723bs: remove unused struct rtw_regulatory 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=20260414081325.142313-1-deep@crimson.net.eu.org \
--to=deep@crimson.net.eu.org \
--cc=error27@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