提交 6e3ab554 编写于 作者: J Johannes Berg

cfg80211: invert P2P-Device vs. netdev check ordering

In cfg80211_can_use_iftype_chan(), check for P2P Device
first, and then for netdevs. This doesn't really change
anything but makes the code a bit easier to read since
it may not be obvious for everyone at first that a P2P
device has no netdev.
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 65e8d5b8
...@@ -1278,12 +1278,12 @@ int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev, ...@@ -1278,12 +1278,12 @@ int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev,
list_for_each_entry(wdev_iter, &rdev->wdev_list, list) { list_for_each_entry(wdev_iter, &rdev->wdev_list, list) {
if (wdev_iter == wdev) if (wdev_iter == wdev)
continue; continue;
if (wdev_iter->netdev) { if (wdev_iter->iftype == NL80211_IFTYPE_P2P_DEVICE) {
if (!netif_running(wdev_iter->netdev))
continue;
} else if (wdev_iter->iftype == NL80211_IFTYPE_P2P_DEVICE) {
if (!wdev_iter->p2p_started) if (!wdev_iter->p2p_started)
continue; continue;
} else if (wdev_iter->netdev) {
if (!netif_running(wdev_iter->netdev))
continue;
} else { } else {
WARN_ON(1); WARN_ON(1);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册