Re: [PATCH v3 2/7] i2c: designware: Optimize flag reading in i2c_dw_read()
From: Andy Shevchenko
Date: Wed Nov 19 2025 - 15:05:21 EST
On Wed, Nov 19, 2025 at 04:05:31PM +0100, Benoît Monin wrote:
> Optimize the i2c_dw_read() function by reading the message flags only
> once per message, rather than for every byte.
>
> The message flags are accessed both in the outer loop and the inner loop,
> so move the declaration of the local flags variable to the outer loop.
>
> The message index is only modified by the outer loop, so reading the
> flags in the inner loop was always getting the same value.
OK.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
--
With Best Regards,
Andy Shevchenko