[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250630083049.103734-3-straube.linux@gmail.com>
Date: Mon, 30 Jun 2025 10:30:48 +0200
From: Michael Straube <straube.linux@...il.com>
To: gregkh@...uxfoundation.org
Cc: hdegoede@...hat.com,
Larry.Finger@...inger.net,
linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org,
Michael Straube <straube.linux@...il.com>
Subject: [PATCH 2/3] 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 <straube.linux@...il.com>
---
.../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 24 +++++++++----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 7fcc46a0bb48..7cc1e036d2c4 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 @@ void rtw_cfg80211_indicate_connect(struct adapter *padapter)
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);
}
--
2.49.0
Powered by blists - more mailing lists