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]

 



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.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[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