linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Eugene Zaikonnikov <ez@norphonic.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	development@norphonic.com, Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-iio <linux-iio@vger.kernel.org>
Subject: Re: [PATCH v9 1/2] iio: humidity: Add TI HDC20x0 support
Date: Sat, 11 Jul 2020 18:27:09 +0300	[thread overview]
Message-ID: <CAHp75VfgFN9YBHo9T8fgswUCnhdb3L5nGEi3_yONvZp5_vduUw@mail.gmail.com> (raw)
In-Reply-To: <86d053d1re.fsf@norphonic.com>

On Fri, Jul 10, 2020 at 2:54 PM Eugene Zaikonnikov <ez@norphonic.com> wrote:
>
> Add support for HDC2010/2080 driver and sysfs documentation for its
> heater element.
>
> HDC2010 is an integrated high-accuracy humidity and temperature sensor
> with very low power consumption. The device includes a resistive heating
> element. The temperature range is -40C to 125C with 0.2C
> accuracy. Humidity measurement is 0 to 100% with 2% RH accuracy.

Now, some almost context-less comments to the contribution.

Please, use Datasheet tag(s) here with URL(s) to the datasheet(s).
Also, be sure you are using https (note S) everywhere.

Datasheet: https://...
Datasheet: ...

> Signed-off-by: Eugene Zaikonnikov <ez@norphonic.com>

1. No need to put file name into the file
2. Missed at least bits.h inclusion
3. Keep comma in HDC2010_GROUP_HUMIDITY
4. IIO_CONST_ATTR can be one line, but hey don't we have IIO core to
take care of it?
5. Use traditional pattern

if (ret)
  return ret;

data->drdy_config = tmp;

return 0;

6. Indent better

if (!i2c_check_functionality(client->adapter,
    I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BYTE | I2C_FUNC_I2C))

(or split last line above by operand per line or alike)

7. Drop unneeded casting
tmp = (data->measurement_config & ~HDC2010_MEAS_CONF) | HDC2010_MEAS_TRIG;

8. It's one line
ret = i2c_smbus_write_byte_data(client,
    HDC2010_REG_MEASUREMENT_CONF, tmp);

Ditto:
dev_warn(&client->dev, "Unable to restore default AMM\n");

In general it doesn't look bad!

-- 
With Best Regards,
Andy Shevchenko

  parent reply	other threads:[~2020-07-11 15:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 11:53 [PATCH v9 1/2] iio: humidity: Add TI HDC20x0 support Eugene Zaikonnikov
2020-07-10 12:20 ` [PATCH v9 2/2] dt-bindings: " Eugene Zaikonnikov
2020-07-12 10:59   ` Jonathan Cameron
2020-07-13 15:38     ` Rob Herring
2020-07-11 15:16 ` [PATCH v9 1/2] " Andy Shevchenko
2020-07-11 15:27 ` Andy Shevchenko [this message]
2020-07-12 10:54   ` Jonathan Cameron
2020-08-04 10:23     ` Eugene Zaikonnikov
2020-08-06 18:46       ` Jonathan Cameron
2020-08-07  7:28         ` Eugene Zaikonnikov
2020-08-03 14:43   ` Eugene Zaikonnikov
2020-08-03 16:37     ` Andy Shevchenko

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=CAHp75VfgFN9YBHo9T8fgswUCnhdb3L5nGEi3_yONvZp5_vduUw@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=development@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).