]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: mac80211: simplify return value handling of cfg80211_get_radio_idx_by_chan()
authorAditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
Tue, 12 Aug 2025 07:23:29 +0000 (12:53 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 4 Sep 2025 09:19:02 +0000 (11:19 +0200)
commitcfb58d5fc964e7e008d8d64c8fa8e9e28e501bc6
tree624091beb89a41a1b56a7e1b06f96aca28701b0f
parent5f9d5fd8e08968e66d0212f782fc24d76e52800f
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>
net/mac80211/cfg.c
net/mac80211/chan.c
net/mac80211/util.c