From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Eugene Zaikonnikov <eugene.zaikonnikov@norphonic.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
Eugene Zalkonnikov <ez@norphonic.com>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
"development@norphonic.com" <development@norphonic.com>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] Driver for TI HDC20x0 humidity and temperature sensors
Date: Mon, 27 Jan 2020 12:06:06 +0000 [thread overview]
Message-ID: <20200127120606.00003931@Huawei.com> (raw)
In-Reply-To: <9d866c18-6643-f76f-df7e-6f29f01274da@norphonic.com>
On Tue, 21 Jan 2020 08:45:21 +0000
Eugene Zaikonnikov <eugene.zaikonnikov@norphonic.com> wrote:
> Hi Jonathan,
>
>
> On 23.12.2019 18:16, Jonathan Cameron wrote:
> >
> > As below. Why change the existing return value?
> >
> >> + }
> >> + return ret;
> >> + }
> >> + case IIO_CHAN_INFO_PEAK: {
> >> + int ret;
> >> +
> >> + ret = iio_device_claim_direct_mode(indio_dev);
> >> + if (ret)
> >> + return ret;
> >> + mutex_lock(&data->lock);
> >> + ret = hdc2010_get_measurement_byte(data, chan);
> >> + mutex_unlock(&data->lock);
> >> + iio_device_release_direct_mode(indio_dev);
> >> + if (ret >= 0) {
> >> + /* Scaling up the value so we can use same offset as RAW */
> >> + *val = ret * 256;
> >> + ret = IIO_VAL_INT;
> >> + } else
> > Why overwrite ret? That might provide better information
> > on what went wrong.
>
> As with the other stylistic notes before, no good reason other than how it was handled in other drivers in the tree. So I assumed it was the practice. Will tidy up later this week I hope and send a new patchset.
We should look to clean up any cases where a valid error code is
overwritten with no good reason. I thought we were pretty good
on that generally but there may be some still hiding in various
drivers.
Thanks,
Jonathan
prev parent reply other threads:[~2020-01-27 12:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-13 15:55 [PATCH v3 1/2] Driver for TI HDC20x0 humidity and temperature sensors Eugene Zalkonnikov
2019-12-13 15:57 ` [PATCH v3 2/2] Device tree bindings " Eugene Zalkonnikov
2019-12-23 17:11 ` Jonathan Cameron
2019-12-23 17:16 ` [PATCH v3 1/2] Driver " Jonathan Cameron
2020-01-21 8:45 ` Eugene Zaikonnikov
2020-01-27 12:06 ` Jonathan Cameron [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=20200127120606.00003931@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=development@norphonic.com \
--cc=eugene.zaikonnikov@norphonic.com \
--cc=ez@norphonic.com \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.