[PATCH 08/20] iio: accel: cros_ec_accel_legacy: make use of iio_get_masklength()

Alexandru Ardelean aardelean at baylibre.com
Tue Jul 2 23:37:26 PDT 2024


On Tue, Jul 2, 2024 at 7:02 PM Nuno Sa via B4 Relay
<devnull+nuno.sa.analog.com at kernel.org> wrote:
>
> From: Nuno Sa <nuno.sa at analog.com>
>
> Ue iio_get_masklength() to access '.masklength' so it can be annotated
> as __private when there are no more direct users of it.
>

I would have suggested maybe a "iio_for_each_active_channel()" here
instead, but after looking into the driver a bit more, it looks like
it's part of a broader rework.

Reviewed-by: Alexandru Ardelean <aardelean at baylibre.com>

> Signed-off-by: Nuno Sa <nuno.sa at analog.com>
> ---
>  drivers/iio/accel/cros_ec_accel_legacy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/accel/cros_ec_accel_legacy.c b/drivers/iio/accel/cros_ec_accel_legacy.c
> index 0f403342b1fc..f7e4dc02b34d 100644
> --- a/drivers/iio/accel/cros_ec_accel_legacy.c
> +++ b/drivers/iio/accel/cros_ec_accel_legacy.c
> @@ -62,7 +62,7 @@ static int cros_ec_accel_legacy_read_cmd(struct iio_dev *indio_dev,
>                 return ret;
>         }
>
> -       for_each_set_bit(i, &scan_mask, indio_dev->masklength) {
> +       for_each_set_bit(i, &scan_mask, iio_get_masklength(indio_dev)) {
>                 *data = st->resp->dump.sensor[sensor_num].data[i] *
>                         st->sign[i];
>                 data++;
>
> --
> 2.45.2
>
>
>



More information about the linux-arm-kernel mailing list