Re: [PATCH 4/4] input: joystick: Fix buffer data parsing

From: Andy Shevchenko
Date: Fri Aug 19 2022 - 04:22:11 EST


On Wed, Aug 17, 2022 at 1:58 PM Artur Rojek <contact@xxxxxxxxxxxxxx> wrote:
>
> Don't try to access buffer data of a channel by its scan index. Instead,
> use the newly introduced `iio_find_channel_offset_in_buffer` to get the
> correct data offset.
>
> The scan index of a channel does not represent its position in a buffer,
> as the buffer will contain data for enabled channels only, affecting
> data offsets and alignment.

> Fixes: 2c2b364fddd5 ("Input: joystick - add ADC attached joystick driver.")

You may not use Fixes here because it has dependencies. The possible
solutions are:
1/
a) create a real fix for the existing code;
b) refactor it.

2/
put the Fixes tag to all dependencies (which is questionable).


> Reported-by: Chris Morgan <macromorgan@xxxxxxxxxxx>
> Tested-by: Paul Cercueil <paul@xxxxxxxxxxxxxxx>
> Signed-off-by: Artur Rojek <contact@xxxxxxxxxxxxxx>

Try to keep tags in chronological order, I do not believe the change
may be tested before it has been created.

--
With Best Regards,
Andy Shevchenko