From: Michael Straube Date: Mon, 30 Jun 2025 08:30:48 +0000 (+0200) Subject: staging: rtl8723bs: remove unnesessary function parameter X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1267d12f5e9a16d33e9bf68c6bf8d7e5b43f45d8;p=thirdparty%2Flinux.git staging: rtl8723bs: remove unnesessary function parameter 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 Link: https://lore.kernel.org/r/20250630083049.103734-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index 7fcc46a0bb48f..7cc1e036d2c45 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -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); }