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]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux