Re: [PATCH v3 2/7] i2c: designware: Optimize flag reading in i2c_dw_read()

Andy Shevchenko
2025-11-19T20:05:21Z

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@linux.intel.com>

--
With Best Regards,
Andy Shevchenko