From 49bba7ef33dca745978bb59c3a06e2da46c362b6 Mon Sep 17 00:00:00 2001 From: Michael Straube Date: Mon, 30 Jun 2025 10:30:49 +0200 Subject: [PATCH] staging: rtl8723bs: remove redundant static function Both wifi_regd.c and ioctl_cfg80211.c define a static function rtw_ieee80211_channel_to_frequency() with identical functionality. Remove the function from wifi_regd.c and make it non-static in ioctl_cfg80211.c to avoid code duplication. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20250630083049.103734-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/ioctl_cfg80211.h | 1 + drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 +- drivers/staging/rtl8723bs/os_dep/wifi_regd.c | 11 ----------- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/ioctl_cfg80211.h b/drivers/staging/rtl8723bs/include/ioctl_cfg80211.h index 993a7b3c3d22b..753009b074511 100644 --- a/drivers/staging/rtl8723bs/include/ioctl_cfg80211.h +++ b/drivers/staging/rtl8723bs/include/ioctl_cfg80211.h @@ -94,6 +94,7 @@ void rtw_cfg80211_init_wiphy(struct adapter *padapter); void rtw_cfg80211_unlink_bss(struct adapter *padapter, struct wlan_network *pnetwork); void rtw_cfg80211_surveydone_event_callback(struct adapter *padapter); +int rtw_ieee80211_channel_to_frequency(int chan); struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wlan_network *pnetwork); int rtw_cfg80211_check_bss(struct adapter *padapter); void rtw_cfg80211_ibss_indicate_connect(struct adapter *padapter); diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index 7cc1e036d2c45..eddf6da27a20d 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -192,7 +192,7 @@ rtw_cfg80211_default_mgmt_stypes[NUM_NL80211_IFTYPES] = { }, }; -static int rtw_ieee80211_channel_to_frequency(int chan) +int rtw_ieee80211_channel_to_frequency(int chan) { /* NL80211_BAND_2GHZ */ if (chan == 14) diff --git a/drivers/staging/rtl8723bs/os_dep/wifi_regd.c b/drivers/staging/rtl8723bs/os_dep/wifi_regd.c index ac0b58a8b5d36..f9c4d487badf0 100644 --- a/drivers/staging/rtl8723bs/os_dep/wifi_regd.c +++ b/drivers/staging/rtl8723bs/os_dep/wifi_regd.c @@ -41,17 +41,6 @@ static const struct ieee80211_regdomain rtw_regdom_rd = { } }; -static int rtw_ieee80211_channel_to_frequency(int chan) -{ - /* NL80211_BAND_2GHZ */ - if (chan == 14) - return 2484; - else if (chan < 14) - return 2407 + chan * 5; - else - return 0; /* not supported */ -} - static void _rtw_reg_apply_flags(struct wiphy *wiphy) { struct adapter *padapter = wiphy_to_adapter(wiphy); -- 2.47.2