[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250709090041.26605105@pumpkin>
Date: Wed, 9 Jul 2025 09:00:41 +0100
From: David Laight <david.laight.linux@...il.com>
To: Qianfeng Rong <rongqianfeng@...o.com>
Cc: Jonathan Cameron <Jonathan.Cameron@...wei.com>, Patrice Chotard
<patrice.chotard@...s.st.com>, Andi Shyti <andi.shyti@...nel.org>,
linux-arm-kernel@...ts.infradead.org, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org, opensource.kernel@...o.com
Subject: Re: [PATCH v2] i2c: busses: Use min() to improve code
On Tue, 8 Jul 2025 10:05:58 +0800
Qianfeng Rong <rongqianfeng@...o.com> wrote:
> 在 2025/7/7 17:40, Jonathan Cameron 写道:
> >> Signed-off-by: Qianfeng Rong <rongqianfeng@...o.com>
> >> Reviewed-by: Patrice Chotard <patrice.chotard@...s.st.com>
> > Drive by review...
...
> > Given it is now one statement perhaps cleaner toput it
> > as the loop initializer
> >
> > for (i = min(c->count, SSC_TXFIFO_SIZE - tx_fstat);
> > i > 0; i--, c->count--, c->buf++)
> >
> Got it. Will do in the next version.
Not sure whether that is better.
The continuation line makes the 'for' statement a bit harder to parse.
I'll move the 'initialisation' out of a 'for' statement to get it to
fit on one line.
David
>
> Best regards,
> Qianfeng
>
>
Powered by blists - more mailing lists