* [PATCH 0/3] rtlwifi deadcoding
@ 2025-04-25 23:53 linux
2025-04-25 23:53 ` [PATCH 1/3] wifi: rtlwifi: Remove unused rtl_usb_{resume|suspend} linux
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: linux @ 2025-04-25 23:53 UTC (permalink / raw)
To: pkshih, linux-wireless; +Cc: linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
Hi,
A bunch of small deadcode cleanups for unused functions, many
of which are empty anyway.
However, one odd thing I noticed while preparing these is
rtl8188ee_bt_hw_init() in
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
isn't called - lots of the other models have similarly
named functions that are called; is that a bug just
forgetting to call it?
Dave
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Dr. David Alan Gilbert (3):
wifi: rtlwifi: Remove unused rtl_usb_{resume|suspend}
wifi: rtlwifi: Remove uncalled stub rtl*_phy_ap_calibrate
wifi: rtlwifi: Remove unused rtl_bb_delay()
drivers/net/wireless/realtek/rtlwifi/core.c | 11 -----------
drivers/net/wireless/realtek/rtlwifi/core.h | 1 -
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 5 -----
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.h | 1 -
drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.c | 5 -----
drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.h | 1 -
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c | 4 ----
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.h | 1 -
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 4 ----
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.h | 1 -
drivers/net/wireless/realtek/rtlwifi/usb.c | 12 ------------
drivers/net/wireless/realtek/rtlwifi/usb.h | 2 --
12 files changed, 48 deletions(-)
--
2.49.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] wifi: rtlwifi: Remove unused rtl_usb_{resume|suspend}
2025-04-25 23:53 [PATCH 0/3] rtlwifi deadcoding linux
@ 2025-04-25 23:53 ` linux
2025-05-05 1:31 ` Ping-Ke Shih
2025-04-25 23:53 ` [PATCH 2/3] wifi: rtlwifi: Remove uncalled stub rtl*_phy_ap_calibrate linux
2025-04-25 23:53 ` [PATCH 3/3] wifi: rtlwifi: Remove unused rtl_bb_delay() linux
2 siblings, 1 reply; 7+ messages in thread
From: linux @ 2025-04-25 23:53 UTC (permalink / raw)
To: pkshih, linux-wireless; +Cc: linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
rtl_usb_resume() and rtl_usb_suspend() are trivial stubs that were
added in 2011's
commit 2ca20f79e0d8 ("rtlwifi: Add usb driver")
but aren't wired up anywhere (though commit 442888c706e9 ("rtlwifi:
rtl8192cu: Add routines dm, fw, led and sw") added commented
out assignments).
Remove them.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/net/wireless/realtek/rtlwifi/usb.c | 12 ------------
drivers/net/wireless/realtek/rtlwifi/usb.h | 2 --
2 files changed, 14 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c
index f5718e570011..d35ed56d6db9 100644
--- a/drivers/net/wireless/realtek/rtlwifi/usb.c
+++ b/drivers/net/wireless/realtek/rtlwifi/usb.c
@@ -1077,15 +1077,3 @@ void rtl_usb_disconnect(struct usb_interface *intf)
ieee80211_free_hw(hw);
}
EXPORT_SYMBOL(rtl_usb_disconnect);
-
-int rtl_usb_suspend(struct usb_interface *pusb_intf, pm_message_t message)
-{
- return 0;
-}
-EXPORT_SYMBOL(rtl_usb_suspend);
-
-int rtl_usb_resume(struct usb_interface *pusb_intf)
-{
- return 0;
-}
-EXPORT_SYMBOL(rtl_usb_resume);
diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.h b/drivers/net/wireless/realtek/rtlwifi/usb.h
index b66d6f9ae564..b873bbc9c4c2 100644
--- a/drivers/net/wireless/realtek/rtlwifi/usb.h
+++ b/drivers/net/wireless/realtek/rtlwifi/usb.h
@@ -138,7 +138,5 @@ int rtl_usb_probe(struct usb_interface *intf,
const struct usb_device_id *id,
const struct rtl_hal_cfg *rtl92cu_hal_cfg);
void rtl_usb_disconnect(struct usb_interface *intf);
-int rtl_usb_suspend(struct usb_interface *pusb_intf, pm_message_t message);
-int rtl_usb_resume(struct usb_interface *pusb_intf);
#endif
--
2.49.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] wifi: rtlwifi: Remove uncalled stub rtl*_phy_ap_calibrate
2025-04-25 23:53 [PATCH 0/3] rtlwifi deadcoding linux
2025-04-25 23:53 ` [PATCH 1/3] wifi: rtlwifi: Remove unused rtl_usb_{resume|suspend} linux
@ 2025-04-25 23:53 ` linux
2025-04-25 23:53 ` [PATCH 3/3] wifi: rtlwifi: Remove unused rtl_bb_delay() linux
2 siblings, 0 replies; 7+ messages in thread
From: linux @ 2025-04-25 23:53 UTC (permalink / raw)
To: pkshih, linux-wireless; +Cc: linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
rtl92d_phy_ap_calibrate(),
rtl92du_phy_ap_calibrate(),
rtl92ee_phy_ap_calibrate(), and
rtl8821ae_phy_ap_calibrate()
are all empty function stubs that are never called anywhere.
Remove them.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 5 -----
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.h | 1 -
drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.c | 5 -----
drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.h | 1 -
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c | 4 ----
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.h | 1 -
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 4 ----
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.h | 1 -
8 files changed, 22 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
index e07402e73ba3..68f890050afb 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
@@ -2055,11 +2055,6 @@ void rtl92d_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t)
RTPRINT(rtlpriv, FINIT, INIT_IQK, "LCK:Finish!!!\n");
}
-void rtl92d_phy_ap_calibrate(struct ieee80211_hw *hw, s8 delta)
-{
- return;
-}
-
static bool _rtl92d_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
u32 cmdtableidx, u32 cmdtablesz, enum swchnlcmd_id cmdid,
u32 para1, u32 para2, u32 msdelay)
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.h b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.h
index bbe9ef77225e..a9bfe54f2802 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.h
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.h
@@ -83,7 +83,6 @@ void rtl92d_phy_set_poweron(struct ieee80211_hw *hw);
bool rtl92d_phy_check_poweroff(struct ieee80211_hw *hw);
void rtl92d_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t);
void rtl92d_update_bbrf_configuration(struct ieee80211_hw *hw);
-void rtl92d_phy_ap_calibrate(struct ieee80211_hw *hw, s8 delta);
void rtl92d_phy_iq_calibrate(struct ieee80211_hw *hw);
void rtl92d_phy_reload_iqk_setting(struct ieee80211_hw *hw, u8 channel);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.c
index 289ec71ce3e5..8c2167cc1f13 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.c
@@ -2445,11 +2445,6 @@ void rtl92du_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t)
RTPRINT(rtlpriv, FINIT, INIT_IQK, "LCK:Finish!!!\n");
}
-void rtl92du_phy_ap_calibrate(struct ieee80211_hw *hw, s8 delta)
-{
- /* Nothing to do. */
-}
-
u8 rtl92du_phy_sw_chnl(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.h b/drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.h
index 090a6203db7e..a107a5a76beb 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.h
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.h
@@ -24,7 +24,6 @@ void rtl92du_phy_set_poweron(struct ieee80211_hw *hw);
bool rtl92du_phy_check_poweroff(struct ieee80211_hw *hw);
void rtl92du_phy_lc_calibrate(struct ieee80211_hw *hw, bool is2t);
void rtl92du_update_bbrf_configuration(struct ieee80211_hw *hw);
-void rtl92du_phy_ap_calibrate(struct ieee80211_hw *hw, s8 delta);
void rtl92du_phy_iq_calibrate(struct ieee80211_hw *hw);
void rtl92du_phy_reload_iqk_setting(struct ieee80211_hw *hw, u8 channel);
void rtl92du_phy_init_pa_bias(struct ieee80211_hw *hw);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
index 73ef602bfb01..1e7f0cd1c86e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
@@ -2926,10 +2926,6 @@ void rtl92ee_phy_lc_calibrate(struct ieee80211_hw *hw)
rtlphy->lck_inprogress = false;
}
-void rtl92ee_phy_ap_calibrate(struct ieee80211_hw *hw, s8 delta)
-{
-}
-
void rtl92ee_phy_set_rfpath_switch(struct ieee80211_hw *hw, bool bmain)
{
_rtl92ee_phy_set_rfpath_switch(hw, bmain, false);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.h b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.h
index 1a5dbc628379..ec4c26b81c48 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.h
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.h
@@ -119,7 +119,6 @@ void rtl92ee_phy_set_bw_mode(struct ieee80211_hw *hw,
void rtl92ee_phy_sw_chnl_callback(struct ieee80211_hw *hw);
u8 rtl92ee_phy_sw_chnl(struct ieee80211_hw *hw);
void rtl92ee_phy_iq_calibrate(struct ieee80211_hw *hw, bool b_recovery);
-void rtl92ee_phy_ap_calibrate(struct ieee80211_hw *hw, s8 delta);
void rtl92ee_phy_lc_calibrate(struct ieee80211_hw *hw);
void rtl92ee_phy_set_rfpath_switch(struct ieee80211_hw *hw, bool bmain);
bool rtl92ee_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
index 9eddbada8af1..13a05066e8a6 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
@@ -4586,10 +4586,6 @@ void rtl8821ae_phy_lc_calibrate(struct ieee80211_hw *hw)
{
}
-void rtl8821ae_phy_ap_calibrate(struct ieee80211_hw *hw, s8 delta)
-{
-}
-
void rtl8821ae_phy_set_rfpath_switch(struct ieee80211_hw *hw, bool bmain)
{
_rtl8821ae_phy_set_rfpath_switch(hw, bmain);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.h b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.h
index 35b7d0f70125..90bf5462a3f8 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.h
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.h
@@ -214,7 +214,6 @@ void rtl8821ae_phy_iq_calibrate(struct ieee80211_hw *hw,
bool b_recovery);
void rtl8812ae_phy_iq_calibrate(struct ieee80211_hw *hw,
bool b_recovery);
-void rtl8821ae_phy_ap_calibrate(struct ieee80211_hw *hw, s8 delta);
void rtl8821ae_phy_lc_calibrate(struct ieee80211_hw *hw);
void rtl8821ae_phy_set_rfpath_switch(struct ieee80211_hw *hw, bool bmain);
bool rtl8812ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
--
2.49.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] wifi: rtlwifi: Remove unused rtl_bb_delay()
2025-04-25 23:53 [PATCH 0/3] rtlwifi deadcoding linux
2025-04-25 23:53 ` [PATCH 1/3] wifi: rtlwifi: Remove unused rtl_usb_{resume|suspend} linux
2025-04-25 23:53 ` [PATCH 2/3] wifi: rtlwifi: Remove uncalled stub rtl*_phy_ap_calibrate linux
@ 2025-04-25 23:53 ` linux
2 siblings, 0 replies; 7+ messages in thread
From: linux @ 2025-04-25 23:53 UTC (permalink / raw)
To: pkshih, linux-wireless; +Cc: linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
The last use of rtl_bb_delay() was removed in 2014's
commit 5c99f04fec93 ("rtlwifi: rtl8723be: Update driver to match Realtek
release of 06/28/14")
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
drivers/net/wireless/realtek/rtlwifi/core.c | 11 -----------
drivers/net/wireless/realtek/rtlwifi/core.h | 1 -
2 files changed, 12 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
index 7537f04b1930..819cf519e66e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -58,17 +58,6 @@ void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path rfpath, u32 addr,
}
EXPORT_SYMBOL(rtl_rfreg_delay);
-void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data)
-{
- if (addr >= 0xf9 && addr <= 0xfe) {
- rtl_addr_delay(addr);
- } else {
- rtl_set_bbreg(hw, addr, MASKDWORD, data);
- udelay(1);
- }
-}
-EXPORT_SYMBOL(rtl_bb_delay);
-
static void rtl_fw_do_work(const struct firmware *firmware, void *context,
bool is_wow)
{
diff --git a/drivers/net/wireless/realtek/rtlwifi/core.h b/drivers/net/wireless/realtek/rtlwifi/core.h
index 42c2d9e13bb8..45225d89ac5e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/core.h
+++ b/drivers/net/wireless/realtek/rtlwifi/core.h
@@ -58,7 +58,6 @@ void rtl_wowlan_fw_cb(const struct firmware *firmware, void *context);
void rtl_addr_delay(u32 addr);
void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path rfpath, u32 addr,
u32 mask, u32 data);
-void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data);
bool rtl_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb);
bool rtl_btc_status_false(void);
void rtl_dm_diginit(struct ieee80211_hw *hw, u32 cur_igval);
--
2.49.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] wifi: rtlwifi: Remove unused rtl_usb_{resume|suspend}
2025-04-25 23:53 ` [PATCH 1/3] wifi: rtlwifi: Remove unused rtl_usb_{resume|suspend} linux
@ 2025-05-05 1:31 ` Ping-Ke Shih
2025-05-05 1:39 ` Dr. David Alan Gilbert
0 siblings, 1 reply; 7+ messages in thread
From: Ping-Ke Shih @ 2025-05-05 1:31 UTC (permalink / raw)
To: linux, pkshih, linux-wireless; +Cc: linux-kernel, Dr. David Alan Gilbert
linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> rtl_usb_resume() and rtl_usb_suspend() are trivial stubs that were
> added in 2011's
> commit 2ca20f79e0d8 ("rtlwifi: Add usb driver")
> but aren't wired up anywhere (though commit 442888c706e9 ("rtlwifi:
> rtl8192cu: Add routines dm, fw, led and sw") added commented
> out assignments).
>
> Remove them.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
3 patch(es) applied to rtw-next branch of rtw.git, thanks.
d559636e382a wifi: rtlwifi: Remove unused rtl_usb_{resume|suspend}
2d867b18eb93 wifi: rtlwifi: Remove uncalled stub rtl*_phy_ap_calibrate
406dac790c25 wifi: rtlwifi: Remove unused rtl_bb_delay()
---
https://github.com/pkshih/rtw.git
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] wifi: rtlwifi: Remove unused rtl_usb_{resume|suspend}
2025-05-05 1:31 ` Ping-Ke Shih
@ 2025-05-05 1:39 ` Dr. David Alan Gilbert
2025-05-05 2:07 ` Ping-Ke Shih
0 siblings, 1 reply; 7+ messages in thread
From: Dr. David Alan Gilbert @ 2025-05-05 1:39 UTC (permalink / raw)
To: Ping-Ke Shih; +Cc: linux-wireless, linux-kernel
* Ping-Ke Shih (pkshih@realtek.com) wrote:
> linux@treblig.org wrote:
>
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> >
> > rtl_usb_resume() and rtl_usb_suspend() are trivial stubs that were
> > added in 2011's
> > commit 2ca20f79e0d8 ("rtlwifi: Add usb driver")
> > but aren't wired up anywhere (though commit 442888c706e9 ("rtlwifi:
> > rtl8192cu: Add routines dm, fw, led and sw") added commented
> > out assignments).
> >
> > Remove them.
> >
> > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
>
> 3 patch(es) applied to rtw-next branch of rtw.git, thanks.
>
> d559636e382a wifi: rtlwifi: Remove unused rtl_usb_{resume|suspend}
> 2d867b18eb93 wifi: rtlwifi: Remove uncalled stub rtl*_phy_ap_calibrate
> 406dac790c25 wifi: rtlwifi: Remove unused rtl_bb_delay()
Thanks!
Did you see the question in the 0/3 cover letter asking why
rtl8188ee_bt_hw_init() isn't called?
Dave
> ---
> https://github.com/pkshih/rtw.git
>
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ dave @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH 1/3] wifi: rtlwifi: Remove unused rtl_usb_{resume|suspend}
2025-05-05 1:39 ` Dr. David Alan Gilbert
@ 2025-05-05 2:07 ` Ping-Ke Shih
0 siblings, 0 replies; 7+ messages in thread
From: Ping-Ke Shih @ 2025-05-05 2:07 UTC (permalink / raw)
To: Dr. David Alan Gilbert
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
> Did you see the question in the 0/3 cover letter asking why
> rtl8188ee_bt_hw_init() isn't called?
Checked vendor driver. For RTL8188E, only USB interface implements this function,
but no caller. The PCI interface doesn't support Bluetooth.
I think you can find the vendor drivers in github or somewhere. That's not
too hard to address this.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-05-05 2:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-25 23:53 [PATCH 0/3] rtlwifi deadcoding linux
2025-04-25 23:53 ` [PATCH 1/3] wifi: rtlwifi: Remove unused rtl_usb_{resume|suspend} linux
2025-05-05 1:31 ` Ping-Ke Shih
2025-05-05 1:39 ` Dr. David Alan Gilbert
2025-05-05 2:07 ` Ping-Ke Shih
2025-04-25 23:53 ` [PATCH 2/3] wifi: rtlwifi: Remove uncalled stub rtl*_phy_ap_calibrate linux
2025-04-25 23:53 ` [PATCH 3/3] wifi: rtlwifi: Remove unused rtl_bb_delay() linux
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox