Commit d220c49
committed
wifi: mac80211: simplify return value handling of cfg80211_get_radio_idx_by_chan()
JIRA: https://issues.redhat.com/browse/RHEL-114891
commit cfb58d5
Author: Aditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
Date: Tue Aug 12 12:53:29 2025 +0530
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>
Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>1 parent 3c97974 commit d220c49
3 files changed
+6
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3690 | 3690 | | |
3691 | 3691 | | |
3692 | 3692 | | |
3693 | | - | |
3694 | | - | |
3695 | | - | |
3696 | 3693 | | |
3697 | | - | |
3698 | | - | |
3699 | 3694 | | |
3700 | 3695 | | |
3701 | 3696 | | |
| |||
3714 | 3709 | | |
3715 | 3710 | | |
3716 | 3711 | | |
3717 | | - | |
3718 | | - | |
3719 | | - | |
3720 | | - | |
3721 | | - | |
3722 | | - | |
3723 | | - | |
3724 | | - | |
3725 | 3712 | | |
3726 | 3713 | | |
3727 | 3714 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
659 | 659 | | |
660 | 660 | | |
661 | 661 | | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | 662 | | |
666 | 663 | | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | 664 | | |
676 | 665 | | |
677 | 666 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4022 | 4022 | | |
4023 | 4023 | | |
4024 | 4024 | | |
4025 | | - | |
4026 | | - | |
4027 | | - | |
4028 | | - | |
4029 | | - | |
4030 | | - | |
4031 | | - | |
4032 | | - | |
4033 | | - | |
4034 | 4025 | | |
| 4026 | + | |
| 4027 | + | |
| 4028 | + | |
| 4029 | + | |
| 4030 | + | |
| 4031 | + | |
4035 | 4032 | | |
4036 | 4033 | | |
4037 | 4034 | | |
| |||
0 commit comments