From: Johannes Berg Date: Fri, 19 Apr 2013 10:19:39 +0000 (+0200) Subject: cfg80211: invert P2P-Device vs. netdev check ordering X-Git-Tag: v4.0~4055^2~21^2^2~80^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6e3ab5543bed9dffb7d1a6404c3782284a432a70;p=platform%2Fkernel%2Flinux-amlogic.git 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: Johannes Berg --- diff --git a/net/wireless/util.c b/net/wireless/util.c index 3d8a133..a7046a4 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -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) { if (wdev_iter == wdev) continue; - if (wdev_iter->netdev) { - if (!netif_running(wdev_iter->netdev)) - continue; - } else if (wdev_iter->iftype == NL80211_IFTYPE_P2P_DEVICE) { + if (wdev_iter->iftype == NL80211_IFTYPE_P2P_DEVICE) { if (!wdev_iter->p2p_started) continue; + } else if (wdev_iter->netdev) { + if (!netif_running(wdev_iter->netdev)) + continue; } else { WARN_ON(1); }