From: Jonathan Cameron <jic23@kernel.org>
To: Eugene Zalkonnikov <ez@norphonic.com>
Cc: 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 v5 1/2] Driver for TI HDC20x0 humidity and temperature sensors
Date: Fri, 14 Feb 2020 13:53:32 +0000 [thread overview]
Message-ID: <20200214135332.759b5316@archlinux> (raw)
In-Reply-To: <CF7736B3-95D6-43E4-BC69-DDB0DFE2A86A@norphonic.com>
On Thu, 13 Feb 2020 22:13:07 +0000
Eugene Zalkonnikov <ez@norphonic.com> wrote:
> Amended HDC2010/2080 diver and sysfs documentation for its heater element.
>
> Signed-off-by: Eugene Zaikonnikov <eugene.zaikonnikov@norphonic.com>
Sparse through up a brackets warning which made me take a closer look at this
line highlighted below.
> + indio_dev->channels = hdc2010_channels;
> + indio_dev->num_channels = ARRAY_SIZE(hdc2010_channels);
> +
> + /* Enable Automatic Measurement Mode at 5Hz */
> + hdc2010_update_drdy_config(data, HDC2010_AMM, HDC2010_AMM);
> +
> + /*
> + * We enable both temp and humidity measurement.
> + * However the measurement won't start even in AMM until triggered.
> + */
> + tmp = (u8)(~HDC2010_MEAS_CONF |
> + HDC2010_MEAS_TRIG & data->measurement_config) |
> + HDC2010_MEAS_TRIG;
Sparse suggested brackets in this so it made me take a closer look.
I'm fairly sure that's the same as the more natural
(data->measurement_config & ~HDC2010_MEAS_CONF) | HDC2010_MEAS_TRIG;
What am I missing?
> +
> + ret = i2c_smbus_write_byte_data(client,
> + HDC2010_REG_MEASUREMENT_CONF, tmp);
> + if (ret)
> + return ret;
> + data->measurement_config = tmp;
> +
> + return devm_iio_device_register(&client->dev, indio_dev);
> +}
prev parent reply other threads:[~2020-02-14 13:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-13 22:13 [PATCH v5 1/2] Driver for TI HDC20x0 humidity and temperature sensors Eugene Zalkonnikov
2020-02-13 22:18 ` [PATCH v5 2/2] Device tree bindings " Eugene Zalkonnikov
2020-02-14 13:55 ` Jonathan Cameron
2020-02-18 20:19 ` Rob Herring
2020-02-14 13:53 ` 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=20200214135332.759b5316@archlinux \
--to=jic23@kernel.org \
--cc=development@norphonic.com \
--cc=ez@norphonic.com \
--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.