Search Linux Wireless

Re: [PATCH 2/3] lib: Improve EWMA efficiency by using bitshifts

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

 



On Thu December 2 2010 19:20:22 Johannes Berg wrote:
> On Thu, 2010-12-02 at 19:12 +0900, Bruno Randolf wrote:
> > +	/* get bitshift for weight */
> > +	for (n = 0; !(weight & 1); n++)
> > +		weight = weight >> 1;
> > +	WARN_ON(weight > 1 || n < 1);
> 
> I'm sure there's something like log2() (and is_power_of_2() for the
> warning) in the kernel already -- no need to reimplement it...

Ah, thanks for that! Will resend an improved version.

bruno
--
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 Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux