[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aPnJ-inBznSQQPo0@black.igk.intel.com>
Date: Thu, 23 Oct 2025 08:23:54 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Cezar Chiru <chiru.cezar.89@...il.com>
Cc: andi.shyti@...nel.org, wsa+renesas@...g-engineering.com,
linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8 1/1] i2c: pcf8584: Move 'ret' variable inside for
loop, break if ret < 0.
On Wed, Oct 22, 2025 at 04:52:13AM +0300, Cezar Chiru wrote:
> Require spaces around '=' and '<'. Add spaces around binary operators.
> Enforce error fixing based on checkpatch.pl output on file.
> Move 'ret' variable inside for loop. Then check if (ret < 0) break. This
> improves usage of ret variable.
No need to have a cover letter for a single patch.
> Signed-off-by: Cezar Chiru <chiru.cezar.89@...il.com>
> ---
You may use this comment block space for changelog and additional comments if
required.
...
> goto out;
> }
>
> - for (i = 0;ret >= 0 && i < num; i++) {
> - pmsg = &msgs[i];
> + for (i = 0; i < num; i++) {
> + int ret;
>
> + pmsg = &msgs[i];
> ret = pcf_doAddress(adap, pmsg);
>
> /* Send START */
> ret = pcf_sendbytes(i2c_adap, pmsg->buf, pmsg->len,
> (i + 1 == num));
> }
> +
> + if (ret < 0)
> + break;
I think goto out; is better as it's kept consistent with other error path branches above.
> }
>
> out:
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists