[PATCH 1/4] brcm80211: use proper ieee80211 routines
Gábor Stefanik
netrolller.3d at gmail.com
Sun Feb 27 22:46:40 UTC 2011
2011/2/27 Dan Carpenter <error27 at gmail.com>:
> On Sun, Feb 27, 2011 at 11:30:10PM +0100, Gábor Stefanik wrote:
>> >> - lastframe = (fc & IEEE80211_FCTL_MOREFRAGS) == 0;
>> >> + lastframe = ieee80211_has_morefrags(h->frame_control);
>> >
>> > This is reversed. It should be:
>> > if (ieee80211_has_morefrags(h->frame_control))
>> > lastframe = false;
>> > else
>> > lastframe = true;
>>
>> lastframe = !ieee80211_has_morefrags(h->frame_control);
>>
>
> That way is a bit uglier. The ! and the i sort of blend together and
> make it harder to read.
Parenthesize it, then. Branching based on a boolean value, only to
assign a different value to a boolean variable on each branch looks
unprofessional.
Perhaps even add an equality, check? Like this:
if (ieee80211_has_morefrags(h->frame_control) == true)...
>
> regards,
> dan carpenter
>
--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
More information about the devel
mailing list