Re: [PATCH v3] iio: light: opt3001: split opt3001_get_processed() logic
From: Jonathan Cameron
Date: Sun Jul 12 2026 - 21:09:52 EST
>
> > > + if (ret < 0) {
> > > + dev_err(dev, "failed to write register %02x\n",
> > > + OPT3001_LOW_LIMIT);
> > > + return ret;
> > > }
> > >
> > > + return 0;
> >
> > Also can be simply
> >
> > return ret;
> >
> > in both branches.
>
> Yeah, I agonized over this since I did the change you describe in a
> different patchset, and I was advised to do it the way as I did in
> this patch so that it's more readable (i.e. we know which path is
> the successful one). I'm really indifferent to either change and it
> doesn't cut that many lines.
>
This one is a case that tends to split reviewers. I don't personally
care much either way because as you say the code saving is minor (but
good) vs it is a tiny bit fiddlier to read.
So far as I'm concerned either is fine. Andy asked though so go
with that :)
J