lkml.org 
[lkml]   [2024]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 0/3] iio: cleanup masklength usage
On Fri, Apr 26, 2024 at 2:13 AM Nuno Sá <noname.nuno@gmail.com> wrote:
>
> On Thu, 2024-04-25 at 10:03 -0500, David Lechner wrote:
> > While working on other patches I noticed that a few drivers are setting
> > the masklength field of struct iio_dev even though it is marked as
> > [INTERN]. It looks like maybe this was not always the case, but we can
> > safely clean it up now without breaking anything.
> >
> > ---
> > David Lechner (3):
> > iio: adc: ad7266: don't set masklength
> > iio: adc: mxs-lradc-adc: don't set masklength
> > iio: buffer: initialize masklength accumulator to 0
> >
> > drivers/iio/adc/ad7266.c | 1 -
> > drivers/iio/adc/mxs-lradc-adc.c | 1 -
> > drivers/iio/industrialio-buffer.c | 2 +-
> > 3 files changed, 1 insertion(+), 3 deletions(-)
> > ---
> > base-commit: b80ad8e3cd2712b78b98804d1f59199680d8ed91
> > change-id: 20240425-b4-iio-masklength-cleanup-86b632b19901
> >
>
> Hi David,
>
> Nice cleanup. The patches look good to me but there's one thing missing :). As you
> correctly noted, the field should be internal to the IIO core and drivers should not
> touch it. Hence, you need to make sure not driver is using it so we can move it into
> struct iio_dev_opaque [1]. That's the place all the intern fields should, eventually,
> end up.
>
> Now, quite some drivers in the trigger handler will read the masklength for looping
> with for_each_set_bit(). Hence, the straight thing would be an helper to get it.
> Maybe there's a clever way...
>
> I know this is more work than what you had in mind but I think it should be fairly
> simple (hopefully) and since you started it :), maybe we can get the whole thing done
> and remove another [INTERN] member from the iio_dev struct.
>
> [1]: https://elixir.bootlin.com/linux/latest/source/include/linux/iio/iio-opaque.h#L42
>
> - Nuno Sá

Sounds like fun. :-p

I will look into it.

\
 
 \ /
  Last update: 2024-04-26 17:27    [W:0.080 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site