public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch v2] staging: rtl8723bs: remove unused struct rtw_regulatory
@ 2026-04-13 15:24 deep
  0 siblings, 0 replies; 3+ messages in thread
From: deep @ 2026-04-13 15:24 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Greg Kroah-Hartman, linux-staging, linux-kernel,
	Kenet Jovan Sokoli

From: Kenet Jovan Sokoli <deep@crimson.net.eu.org>

The struct rtw_regulatory is never actually used in the rtl8723bs
driver. The functions that take it as a parameter are always passed
NULL, and the functions themselves either ignore the parameter or
perform no logic with it.

Following Dan Carpenter's suggestion, removed the unused struct
definition, removed the unused parameters from the internal functions,
and clean up the dead code.

Suggested by: Dan Carpenter dan.carpenter@linaro.org
Signed-off-by: Kenet Jovan Sokoli <deep@crimson.net.eu.org>
---
 drivers/staging/rtl8723bs/os_dep/wifi_regd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/wifi_regd.c b/drivers/staging/rtl8723bs/os_dep/wifi_regd.c
index c48a1e3ba4ac..3a43d0c8b142 100644
--- a/drivers/staging/rtl8723bs/os_dep/wifi_regd.c
+++ b/drivers/staging/rtl8723bs/os_dep/wifi_regd.c
@@ -97,9 +97,7 @@ static const struct ieee80211_regdomain *_rtw_regdomain_select(void)
 
 static void _rtw_regd_init_wiphy(struct wiphy *wiphy,
 				 void (*reg_notifier)(struct wiphy *wiphy,
-						      struct
-						      regulatory_request *
-						      request))
+						      struct regulatory_request *request))
 {
 	const struct ieee80211_regdomain *regd;
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2] staging: rtl8723bs: remove unused struct rtw_regulatory
@ 2026-04-13 15:44 deep
  2026-04-14  5:55 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: deep @ 2026-04-13 15:44 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Greg Kroah-Hartman, linux-staging, linux-kernel,
	Kenet Jovan Sokoli

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 dan.carpenter@linaro.org
Signed-off-by: Kenet Jovan Sokoli <deep@crimson.net.eu.org>

---

v2: Completely refactored the logic to remove the functions and the
struct entirely as suggested by Dan Carpenter. I'm 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 | 22 +++++++-------------
 2 files changed, 7 insertions(+), 26 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..3a43d0c8b142 100644
--- a/drivers/staging/rtl8723bs/os_dep/wifi_regd.c
+++ b/drivers/staging/rtl8723bs/os_dep/wifi_regd.c
@@ -83,27 +83,21 @@ 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 *
-						      request))
+						      struct regulatory_request *request))
 {
 	const struct ieee80211_regdomain *regd;
 
@@ -113,7 +107,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 +118,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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] staging: rtl8723bs: remove unused struct rtw_regulatory
  2026-04-13 15:44 [PATCH v2] staging: rtl8723bs: remove unused struct rtw_regulatory deep
@ 2026-04-14  5:55 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2026-04-14  5:55 UTC (permalink / raw)
  To: deep; +Cc: Dan Carpenter, Greg Kroah-Hartman, linux-staging, linux-kernel

On Mon, Apr 13, 2026 at 05:44:32PM +0200, deep@crimson.net.eu.org wrote:
>  
> -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 *
> -						      request))
> +						      struct regulatory_request *request))

I wish you hadn't made this extra white space change.  It's unrelated
and confused me when I was reading the patch.  Otherwise the patch looks
good.

Could you resend without that?

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-14  5:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-13 15:44 [PATCH v2] staging: rtl8723bs: remove unused struct rtw_regulatory deep
2026-04-14  5:55 ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2026-04-13 15:24 [patch " deep

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox