Re: [PATCH v7 08/11] iio: adc: hx711: split variable assignments in hx711_read and hx711_reset
From: Jonathan Cameron
Date: Mon May 11 2026 - 10:46:09 EST
On Mon, 11 May 2026 14:22:40 +0300
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
> On Mon, May 11, 2026 at 01:19:30AM +0530, Piyush Patle wrote:
> > Separate the initial value assignments from the declarations in
> > hx711_read() and hx711_reset().
> >
> > This is a small preparatory cleanup before the later loop-iterator and
> > variant-specific changes adjust the local variable layout in these
> > functions.
>
> ...
>
> > static int hx711_reset(struct hx711_data *hx711_data)
> > {
> > - int val = hx711_wait_for_ready(hx711_data);
> > + int val;
> > + val = hx711_wait_for_ready(hx711_data);
> >
> > if (val) {
>
> No, blank line should divide the definitions and code, and should not be in
> semantically coupled places.
>
> ...
>
> Again, no need to resend, but keep in mind if you need a v8, this and other
> comments needs to be addressed.
>
Looks like we are getting a v8 so to make sure this is super clear..
int val;
val = ....
if (val) {
}
is the correct spacing. So also a line missing above val =
that I don't think Andy has called out explicitly.