[PATCH] ath10k: improve vdev map handling.

Ben Greear greearb at candelatech.com
Fri May 16 07:11:11 PDT 2014


On 05/16/2014 07:06 AM, Kalle Valo wrote:
> Ben Greear <greearb at candelatech.com> writes:
> 
>> On 05/16/2014 06:37 AM, Kalle Valo wrote:
>>
>>>> -	ar->free_vdev_map &= ~BIT(arvif->vdev_id);
>>>> +	ar->free_vdev_map &= ~(1 << arvif->vdev_id);
>>>
>>> Why remove the BIT()? Not that it matters much, I just think it's easier
>>> to read when BIT() macro is used. Would be good to convert all cases to
>>> use BIT anyway, but that's for a separate patch.
>>
>> BIT doesn't work on 64-bit numbers (ie, if vdev_id > 31)
> 
> Oh, I didn't know that. Too bad, but then removing it makes sense.
> 
>> and it takes a long time to figure out exactly what it does (try
>> grepping for BIT). Open-coding means much easier to fully understand
>> the code.
> 
> All Linux engineers should know what BIT() does. If not, they should
> learn that ;)

Yeah, but see your comment above :P

Pain in the ass to track down the difference between (1 << x) and (1LLU << x),
and even worse when it's hidden behind a macro.

Ben


-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com




More information about the ath10k mailing list