Search Linux Wireless

Re: ilog2 overkill in ieee80211_get_hdrlen?

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

 



> in 'net/mac80211/util.c', in ieee80211_get_hdrlen (line 175), a function ilog2 
> is used to determine the number of bits to shift for 
> IEEE80211_STYPE_QOS_DATA. isn't that a bit of an overkill when we could just 
> do >> 6? i mean IEEE80211_STYPE_QOS_DATA isn't going to change after all...

Yeah but ilog2() evaluates to a constant here so it doesn't matter, and
I think this is more readable.

> if (fc & IEEE80211_STYPE_QOS_DATA)
> 	hdrlen += 2;
> 
> would be a bit more readable.

It used to be that but that's a branch and the generated code is better
the other way.

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


[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