]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
staging: rtl8723bs: remove redundant static function
authorMichael Straube <straube.linux@gmail.com>
Mon, 30 Jun 2025 08:30:49 +0000 (10:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 Jun 2025 17:15:30 +0000 (19:15 +0200)
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 <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20250630083049.103734-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/include/ioctl_cfg80211.h
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
drivers/staging/rtl8723bs/os_dep/wifi_regd.c

index 993a7b3c3d22b6c20825274bacf996070bbdab49..753009b074511a6bae6d5c22e93732cd6b159ab2 100644 (file)
@@ -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);
index 7cc1e036d2c45602c8fd11432901e5c8f7341eba..eddf6da27a20d5991243621dbb0dd3c1d1267413 100644 (file)
@@ -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)
index ac0b58a8b5d36659fdc06de0011f30972196d395..f9c4d487badf0e5b21a31b5da57c5aff28562500 100644 (file)
@@ -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);