Re: [PATCH V3 4/6] PCI: rcar: Replace (8 * n) with (n << 3)

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

 



On 3/25/19 9:26 AM, Geert Uytterhoeven wrote:
> Hi Marek,
> 
> On Sat, Mar 23, 2019 at 2:54 AM <marek.vasut@xxxxxxxxx> wrote:
>> From: Marek Vasut <marek.vasut+renesas@xxxxxxxxx>
>>
>> Replace (8 * n) with (n << 3) to make bit shift operations consistent.
>> No functional change.
>>
>> Signed-off-by: Marek Vasut <marek.vasut+renesas@xxxxxxxxx>
> 
> Thanks for your patch!
> 
> Where is the inconsistency? The driver consistently uses
>   1. multiplications for bit offset calculations,
>   2. shifts for bit field extraction or insertion.
> 
> While technically equivalent, I think your change makes the code harder
> to read: the values are multiplied by eight to convert from number of
> bytes to number of bits, so IMHO "BITS_PER_BYTE * n" would be more
> readable.

Sure

-- 
Best regards,
Marek Vasut



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux