public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: Qianfeng Rong <rongqianfeng@vivo.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	Andi Shyti <andi.shyti@kernel.org>,
	linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org, opensource.kernel@vivo.com
Subject: Re: [PATCH v2] i2c: busses: Use min() to improve code
Date: Wed, 9 Jul 2025 09:00:41 +0100	[thread overview]
Message-ID: <20250709090041.26605105@pumpkin> (raw)
In-Reply-To: <e6814ec7-b9fb-4185-9929-1e463ef518f6@vivo.com>

On Tue, 8 Jul 2025 10:05:58 +0800
Qianfeng Rong <rongqianfeng@vivo.com> wrote:

> 在 2025/7/7 17:40, Jonathan Cameron 写道:
> >> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
> >> Reviewed-by: Patrice Chotard <patrice.chotard@foss.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
> 
> 



      reply	other threads:[~2025-07-09 10:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-05 11:44 [PATCH v2] i2c: busses: Use min() to improve code Qianfeng Rong
2025-07-07  9:40 ` Jonathan Cameron
2025-07-08  2:05   ` Qianfeng Rong
2025-07-09  8:00     ` David Laight [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250709090041.26605105@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andi.shyti@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=opensource.kernel@vivo.com \
    --cc=patrice.chotard@foss.st.com \
    --cc=rongqianfeng@vivo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox