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

From: Andy Shevchenko

Date: Thu Nov 06 2025 - 06:08:46 EST


On Thu, Nov 06, 2025 at 11:50:36AM +0100, Krzysztof Kozlowski wrote:
> On 31/10/2025 15:48, Andy Shevchenko wrote:
> > On Fri, Oct 31, 2025 at 03:35:40PM +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 index is only modified by the outer loop, so reading the
> >> flags in the inner loop was always getting the same value.
> >
> > Does it affect the binary (compiled) file?
>
> It does not really matter that much, because new code is more readable -
> 'flags' depend on the outer (first) loop and they are used there, so
> that's where variable should be defined.

Did I oppose that?

--
With Best Regards,
Andy Shevchenko