diff options
| author | Aditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com> | 2025-08-12 12:53:29 +0530 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2025-09-04 11:19:02 +0200 |
| commit | cfb58d5fc964e7e008d8d64c8fa8e9e28e501bc6 (patch) | |
| tree | 624091beb89a41a1b56a7e1b06f96aca28701b0f /net/mac80211/cfg.c | |
| parent | 5f9d5fd8e08968e66d0212f782fc24d76e52800f (diff) | |
wifi: mac80211: simplify return value handling of cfg80211_get_radio_idx_by_chan()
In several instances where cfg80211_get_radio_idx_by_chan() is called,
redundant checks are performed across function — such as verifying if
wiphy->n_radio < 2 or if the returned index is negative. These checks are
unnecessary, as the return value can be directly compared. Moreover, the
function can be safely called even when radio-level properties are not
explicitly advertised since in such case in each call it is going to get
same error value.
Therefore, simplify the usage of this function across all such cases by
removing redundant conditions and relying on the return value directly.
Signed-off-by: Aditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
Link: https://patch.msgid.link/20250812-fix_scan_ap_flag_requirement_during_mlo-v4-2-383ffb6da213@oss.qualcomm.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/cfg.c')
| -rw-r--r-- | net/mac80211/cfg.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 4603350989c8..fca93cd36bd3 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3683,12 +3683,7 @@ static bool ieee80211_is_scan_ongoing(struct wiphy *wiphy, if (list_empty(&local->roc_list) && !local->scanning) return false; - if (wiphy->n_radio < 2) - return true; - req_radio_idx = cfg80211_get_radio_idx_by_chan(wiphy, chandef->chan); - if (req_radio_idx < 0) - return true; if (local->scanning) { scan_req = wiphy_dereference(wiphy, local->scan_req); @@ -3707,14 +3702,6 @@ static bool ieee80211_is_scan_ongoing(struct wiphy *wiphy, list_for_each_entry(roc, &local->roc_list, list) { chan_radio_idx = cfg80211_get_radio_idx_by_chan(wiphy, roc->chan); - /* - * The roc work is added but chan_radio_idx is invalid. - * Should not happen but if it does, let's not take - * risk and return true. - */ - if (chan_radio_idx < 0) - return true; - if (chan_radio_idx == req_radio_idx) return true; } |
