Re: [PATCH v1] iio: gyro: mpu3050: Use get_unaligned_leXX()

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

 



On Thu, Oct 29, 2020 at 5:05 PM Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
>
> On Mon, 26 Oct 2020 19:53:40 +0200
> Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
>
> > This makes the driver code slightly easier to read.
> >
> > Cc: Linus Walleij <linus.walleij@xxxxxxxxxx>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
>
> What you have is good, but could we do better?
>
> Why not use an __le64 to grab the whole thing, convert it to a local
> cpu endian u64 then use FIELD_GET or similar to pull out the right bits.
> Would be fairly self documenting as well which is always nice.
>
> Or am I missing something?

My laziness. I shared this as a leftover from a big series of
converting a lot of drivers to get_unligned_.eXX(). If you consider
this is not good enough, just don't apply (no hard feelings :-) I will
drop it from my local branches.

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux