Search Linux Wireless

Re: [PATCH v3 5/7] cfg80211/mac80211: refactor cfg80211_chandef_dfs_required()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2014-02-20 at 16:36 +0200, Luciano Coelho wrote:

> +	radar_required = !!(err);

That's going a bit overboard - you really need only ... = err; for bool
variables :) 

>  	int width;
> -	int r;
> +	int ret;
>  
>  	if (WARN_ON(!cfg80211_chandef_valid(chandef)))
>  		return -EINVAL;
>  
> -	width = cfg80211_chandef_get_width(chandef);
> -	if (width < 0)
> -		return -EINVAL;
> +	switch (iftype) {
> +	case NL80211_IFTYPE_UNSPECIFIED:
> +	case NL80211_IFTYPE_ADHOC:
> +	case NL80211_IFTYPE_AP:
> +	case NL80211_IFTYPE_P2P_GO:
> +	case NL80211_IFTYPE_MESH_POINT:
> +		width = cfg80211_chandef_get_width(chandef);
> +		if (width < 0)
> +			return -EINVAL;
>  
> -	r = cfg80211_get_chans_dfs_required(wiphy, chandef->center_freq1,
> -					    width);
> -	if (r)
> -		return r;
> +		ret = cfg80211_get_chans_dfs_required(wiphy,
> +						      chandef->center_freq1,
> +						      width);
> +		if (ret < 0)
> +			return ret;
> +		else if (ret > 0)
> +			return BIT(chandef->width);

What's with the width vs. chandef->width?

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux