Re: [PATCH v8 02/12] iio: ssp_sensors: factor out pending list add/remove helpers

From: Andy Shevchenko

Date: Sun May 17 2026 - 06:36:44 EST


On Fri, May 15, 2026 at 11:10:07PM +0530, Sanjay Chitroda wrote:

> The SSP SPI transfer path manipulates the pending message list in
> multiple places, open-coding the same locking and list operations.
>
> Refactor the pending list add and remove logic into helper functions.
> This reduces duplication and simplifies the transfer flow by
> centralizing the pending list handling.
>
> No functional change intended.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>

...

> + if (!use_no_irq && done &&
> + !wait_for_completion_timeout(done, msecs_to_jiffies(timeout))) {

Better to have logical split:

if (!use_no_irq &&
done && !wait_for_completion_timeout(done, msecs_to_jiffies(timeout))) {

but this will go 84 characters. Perhaps the proposed version is a good compromise.

> + ssp_pending_del(data, msg, use_no_irq);

use_no_irq is false here.

> + data->timeout_cnt++;
> + return -ETIMEDOUT;
> + }

--
With Best Regards,
Andy Shevchenko