Search Linux Wireless

Re: [PATCHv4 03/18] mac80211: fix timing for 5 MHz and 10 MHz channels

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

 



On Thu, 2013-06-27 at 14:44 +0200, Simon Wunderlich wrote:

> +static inline int
> +ieee80211_chandef_get_divisor(struct cfg80211_chan_def *chandef)
> +{
> +	switch (local->hw.conf.chandef.width) {
> +	case NL80211_CHAN_WIDTH_5:
> +		return 4;
> +	case NL80211_CHAN_WIDTH_10:
> +		return 2;
> +	default:
> +		return 1;

I wonder if instead of 'divisor' this should be expressed as a 'shift'.

With this variable divisor, the compiler can't know that it'll be 1/2/4,
so it has to actually use a real division when you use DIV_ROUND_UP. A
shift would be faster, it seems?

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