]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
staging: rtl8723bs: remove unnesessary function parameter
authorMichael Straube <straube.linux@gmail.com>
Mon, 30 Jun 2025 08:30:48 +0000 (10:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 Jun 2025 17:15:30 +0000 (19:15 +0200)
The function rtw_ieee80211_channel_to_frequency() in ioctl_cfg80211.c
is always called with band = NL80211_BAND_2GHZ. Remove the unnecessary
band parameter from the function and adjust its code and calls.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20250630083049.103734-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c

index 7fcc46a0bb48fbd9c8ce2df1dffe227a3717a2dd..7cc1e036d2c45602c8fd11432901e5c8f7341eba 100644 (file)
@@ -192,14 +192,14 @@ rtw_cfg80211_default_mgmt_stypes[NUM_NL80211_IFTYPES] = {
        },
 };
 
-static int rtw_ieee80211_channel_to_frequency(int chan, int band)
+static int rtw_ieee80211_channel_to_frequency(int chan)
 {
-       if (band == NL80211_BAND_2GHZ) {
-               if (chan == 14)
-                       return 2484;
-               else if (chan < 14)
-                       return 2407 + chan * 5;
-       }
+       /* NL80211_BAND_2GHZ */
+       if (chan == 14)
+               return 2484;
+
+       if (chan < 14)
+               return 2407 + chan * 5;
 
        return 0; /* not supported */
 }
@@ -266,7 +266,7 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wl
        /* spin_unlock_bh(&pwdev_priv->scan_req_lock); */
 
        channel = pnetwork->network.configuration.ds_config;
-       freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_2GHZ);
+       freq = rtw_ieee80211_channel_to_frequency(channel);
 
        notify_channel = ieee80211_get_channel(wiphy, freq);
 
@@ -340,7 +340,7 @@ int rtw_cfg80211_check_bss(struct adapter *padapter)
        if (!(pnetwork) || !(padapter->rtw_wdev))
                return false;
 
-       freq = rtw_ieee80211_channel_to_frequency(pnetwork->configuration.ds_config, NL80211_BAND_2GHZ);
+       freq = rtw_ieee80211_channel_to_frequency(pnetwork->configuration.ds_config);
 
        notify_channel = ieee80211_get_channel(padapter->rtw_wdev->wiphy, freq);
        bss = cfg80211_get_bss(padapter->rtw_wdev->wiphy, notify_channel,
@@ -440,7 +440,7 @@ check_bss:
                u16 channel = cur_network->network.configuration.ds_config;
                struct cfg80211_roam_info roam_info = {};
 
-               freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_2GHZ);
+               freq = rtw_ieee80211_channel_to_frequency(channel);
 
                notify_channel = ieee80211_get_channel(wiphy, freq);
 
@@ -1976,7 +1976,7 @@ static int cfg80211_rtw_get_channel(struct wiphy *wiphy, struct wireless_dev *wd
        if (!channel)
                return -ENODATA;
 
-       freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_2GHZ);
+       freq = rtw_ieee80211_channel_to_frequency(channel);
 
        chan = ieee80211_get_channel(adapter->rtw_wdev->wiphy, freq);
 
@@ -2456,7 +2456,7 @@ void rtw_cfg80211_rx_action(struct adapter *adapter, u8 *frame, uint frame_len,
 
        rtw_action_frame_parse(frame, frame_len, &category, &action);
 
-       freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_2GHZ);
+       freq = rtw_ieee80211_channel_to_frequency(channel);
 
        rtw_cfg80211_rx_mgmt(adapter, freq, 0, frame, frame_len, GFP_ATOMIC);
 }