cfg80211: remove radar requirements check from cfg80211_can_use_iftype_chan()

We don't have to double check whether the parameters passed to
cfg80211_can_use_iftype_chan() are correct.  We should just make sure
they *are* when we call this function.

Remove the radar_detect argument check in
cfg80211_can_use_iftype_chan() to simplify the code.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
[keep braces around a long comment + single statement]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Luciano Coelho
2014-02-20 16:36:21 +02:00
committed by Johannes Berg
parent e5d2f95471
commit 7b2106aea2
3 changed files with 10 additions and 34 deletions

View File

@@ -236,6 +236,12 @@ int cfg80211_set_mesh_channel(struct cfg80211_registered_device *rdev,
if (!netif_running(wdev->netdev))
return -ENETDOWN;
/* cfg80211_can_use_chan() calls
* cfg80211_can_use_iftype_chan() with no radar
* detection, so if we're trying to use a radar
* channel here, something is wrong.
*/
WARN_ON_ONCE(chandef->chan->flags & IEEE80211_CHAN_RADAR);
err = cfg80211_can_use_chan(rdev, wdev, chandef->chan,
CHAN_MODE_SHARED);
if (err)