lkml.org 
[lkml]   [2019]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/9] iio: accel: bmc150: add mount matrix support
From
Date

> Am 20.02.2019 um 17:07 schrieb Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
>
> On Wed, Feb 20, 2019 at 03:00:50PM +0100, H. Nikolaus Schaller wrote:
>> This patch allows to read a mount-matrix device tree
>> property and report to user-space or in-kernel iio
>> clients.
>
>> +static const struct iio_mount_matrix *
>> +bmc150_accel_get_mount_matrix(const struct iio_dev *indio_dev,
>> + const struct iio_chan_spec *chan)
>> +{
>> + return &((struct bmc150_accel_data *)iio_priv(indio_dev))->orientation;
>
> It's hard to read.
>
> Can you split such lines in your series to something like
>
> struct bmc150_accel_data *data = iio_priv(indio_dev);
>
> return &data->orientation;
>
> ?

I think I did copy it verbatim from some other iio driver:

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/iio/magnetometer/ak8975.c?h=next-20190220#n745

and checkpatch did not complain.

But yes, it can and should be improved since it seems that
I picked the only bad example as template...

>
>> +}
>> +
>> +static const struct iio_chan_spec_ext_info bmc150_accel_ext_info[] = {
>> + IIO_MOUNT_MATRIX(IIO_SHARED_BY_DIR, bmc150_accel_get_mount_matrix),
>> + { },
>
> Terminator lines better without comma.

Ok.

>
>> +};
>
> --
> With Best Regards,
> Andy Shevchenko
>
>

\
 
 \ /
  Last update: 2019-02-20 17:15    [W:0.104 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site