[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zd9tApJClX7Frq20@smile.fi.intel.com>
Date: Wed, 28 Feb 2024 19:27:30 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Matti Vaittinen <mazziesaccount@...il.com>
Cc: Subhajit Ghosh <subhajit.ghosh@...aklogic.com>,
Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>, Marek Vasut <marex@...x.de>,
Anshul Dalal <anshulusr@...il.com>,
Javier Carrasco <javier.carrasco.cruz@...il.com>,
Matt Ranostay <matt@...ostay.sg>,
Stefan Windfeldt-Prytz <stefan.windfeldt-prytz@...s.com>,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8 5/5] iio: light: Add support for APDS9306 Light Sensor
On Wed, Feb 28, 2024 at 03:08:56PM +0200, Matti Vaittinen wrote:
> On 2/28/24 14:24, Subhajit Ghosh wrote:
..
> > + ret = iio_gts_find_new_gain_by_old_gain_time(&data->gts, gain_old,
> > + intg_old, val2, &gain_new);
>
> You don't use the 'ret' here, so maybe for the clarity, not assign it.
> Or, maybe you wan't to try to squeeze out few cycles for succesful case and
> check the ret for '0' - in which case you should be able to omit the check
> right below as well as the call to iio_find_closest_gain_low(). OTOH, this
> is likely not a "hot path" so I don't care too much about the extra call if
> you think code is clearer this way.
>
> > + if (gain_new < 0) {
> > + dev_err_ratelimited(dev, "Unsupported gain with time\n");
> > + return gain_new;
> > + }
What is the difference between negative response from the function itself and
similar in gain_new?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists