From: Jonathan Cameron <jic23@kernel.org>
To: Joe Perches <joe@perches.com>
Cc: "Hernán Gonzalez" <hernan@vanguardiasur.com.ar>,
knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
gregkh@linuxfoundation.org, Michael.Hennerich@analog.com,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 13/14] Move ad7746 out of staging
Date: Sun, 15 Apr 2018 20:48:55 +0100 [thread overview]
Message-ID: <20180415204855.4393fbd2@archlinux> (raw)
In-Reply-To: <d59b997761d752877a9942e6be664d2ae1d25637.camel@perches.com>
On Sun, 15 Apr 2018 11:46:09 -0700
Joe Perches <joe@perches.com> wrote:
> On Sun, 2018-04-15 at 18:04 +0100, Jonathan Cameron wrote:
> > On Fri, 13 Apr 2018 13:36:50 -0300
> > Hernán Gonzalez <hernan@vanguardiasur.com.ar> wrote:
> >
> > > Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
> >
> > A few comments inline.
>
> And a trivial typo and other bits
>
> > > diff --git a/drivers/iio/cdc/Makefile b/drivers/iio/cdc/Makefile
> []
> > > @@ -0,0 +1,5 @@
> > > +#
> > > +#Makeefile for industrial I/O CDC drivers
>
> Makefile
>
> > > diff --git a/drivers/iio/cdc/ad7746.c b/drivers/iio/cdc/ad7746.c
> []
> > > @@ -0,0 +1,855 @@
>
> Perhaps use the SPDX tags
There was some resistance around this so we dropped it from suggested changes
before moving these drivers out of staging. Can sort it out later.
>
> > > +/*
> > > + * AD7746 capacitive sensor driver supporting AD7745, AD7746 and AD7747
> > > + *
> > > + * Copyright 2011 Analog Devices Inc.
> > > + *
> > > + * Licensed under the GPL-2.
> > > + */
>
> []
>
> > > +static const struct iio_chan_spec ad7746_channels[] = {
> > > + [VIN] = {
> > > + .type = IIO_VOLTAGE,
> > > + .indexed = 1,
> > > + .channel = 0,
> > > + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
> > > + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) |
> > > + BIT(IIO_CHAN_INFO_SAMP_FREQ),
> > > + .address = AD7746_REG_VT_DATA_HIGH << 8 |
> > > + AD7746_VTSETUP_VTMD_EXT_VIN,
> >
> > Hmm. I never like to see a single location used to hold two different things.
> > I would suggest perhaps having address be an enum then have have a lookup
> > into an array of structures that have the two elements separately.
> > (use the ad7746_chan enum again for this?)
>
> And perhaps it's nicer to align the multiple
> BIT(identifier) uses like
>
> .info_mask_shared_by_type = (BIT(IIO_CHAN_INFO_SCALE) |
> BIT(IIO_CHAN_INFO_SAMP_FREQ)),
>
> The extra unnecessary parentheses allow at least emacs
> to align the BIT uses properly.
>
> []
>
> > > + [CIN1] = {
> > > + .type = IIO_CAPACITANCE,
> > > + .indexed = 1,
> > > + .channel = 0,
> > > + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
> > > + BIT(IIO_CHAN_INFO_CALIBSCALE) | BIT(IIO_CHAN_INFO_OFFSET),
> > > + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_CALIBBIAS) |
> > > + BIT(IIO_CHAN_INFO_SCALE) | BIT(IIO_CHAN_INFO_SAMP_FREQ),
> > > + .address = AD7746_REG_CAP_DATA_HIGH << 8,
> > > + },
>
> So this one could be:
>
> .info_mask_shared_by_type = (BIT(IIO_CHAN_INFO_CALIBBIAS) |
> BIT(IIO_CHAN_INFO_SCALE) |
> BIT(IIO_CHAN_INFO_SAMP_FREQ)),
>
> etc...
>
>
next prev parent reply other threads:[~2018-04-15 19:49 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-13 16:36 [PATCH v2 00/14] Move ad7746 driver out of staging Hernán Gonzalez
2018-04-13 16:36 ` [PATCH v2 01/14] staging: iio: ad7746: Automatically swap values in readings/writings Hernán Gonzalez
2018-04-15 15:02 ` Jonathan Cameron
2018-04-13 16:36 ` [PATCH v2 02/14] staging: iio: ad7746: Adjust arguments to match open parenthesis Hernán Gonzalez
2018-04-15 15:03 ` Jonathan Cameron
2018-04-13 16:36 ` [PATCH v2 03/14] staging: iio: ad7746: Fix bound checkings Hernán Gonzalez
2018-04-15 15:05 ` Jonathan Cameron
2018-04-16 14:47 ` Hernán Gonzalez
2018-04-16 14:47 ` Hernán Gonzalez
2018-04-18 9:39 ` Jonathan Cameron
2018-04-21 14:40 ` Jonathan Cameron
2018-04-13 16:36 ` [PATCH v2 04/14] staging: iio: ad7746: Fix multiple line dereference Hernán Gonzalez
2018-04-15 15:07 ` Jonathan Cameron
2018-04-13 16:36 ` [PATCH v2 05/14] staging: iio: ad7746: Reorder includes alphabetically Hernán Gonzalez
2018-04-15 15:09 ` Jonathan Cameron
2018-04-13 16:36 ` [PATCH v2 06/14] staging: iio: ad7746: Reorder variable declarations Hernán Gonzalez
2018-04-15 15:10 ` Jonathan Cameron
2018-04-13 16:36 ` [PATCH v2 07/14] staging: iio: ad7746: Remove unused defines Hernán Gonzalez
2018-04-15 15:12 ` Jonathan Cameron
2018-04-16 14:50 ` Hernán Gonzalez
2018-04-16 14:50 ` Hernán Gonzalez
2018-04-13 16:36 ` [PATCH v2 08/14] staging: iio: ad7746: Add dt-bindings Hernán Gonzalez
2018-04-15 15:19 ` Jonathan Cameron
2018-04-13 16:36 ` [PATCH v2 09/14] staging: iio: ad7746: Add remove() Hernán Gonzalez
2018-04-15 15:31 ` Jonathan Cameron
2018-04-18 19:25 ` Hernán Gonzalez
2018-04-18 19:25 ` Hernán Gonzalez
2018-04-19 9:14 ` Michael Hennerich
2018-04-13 16:36 ` [PATCH v2 10/14] staging: iio: ad7746: Add comments Hernán Gonzalez
2018-04-15 15:35 ` Jonathan Cameron
2018-04-13 16:36 ` [PATCH v2 11/14] staging: iio: ad7746: Add devicetree bindings documentation Hernán Gonzalez
2018-04-15 15:37 ` Jonathan Cameron
2018-04-16 14:55 ` Hernán Gonzalez
2018-04-16 14:55 ` Hernán Gonzalez
2018-04-16 20:08 ` Rob Herring
2018-04-13 16:36 ` [PATCH v2 12/14] staging: iio: ad7746: Add ABI documentation Hernán Gonzalez
2018-04-15 15:40 ` Jonathan Cameron
2018-04-13 16:36 ` [PATCH v2 13/14] Move ad7746 out of staging Hernán Gonzalez
2018-04-15 17:04 ` Jonathan Cameron
2018-04-15 18:46 ` Joe Perches
2018-04-15 19:48 ` Jonathan Cameron [this message]
2018-04-13 16:36 ` [PATCH v2 14/14] staging: iio: Remove ad7746 from staging Hernán Gonzalez
2018-04-15 15:43 ` Jonathan Cameron
2018-04-15 19:24 ` Joe Perches
2018-04-15 19:52 ` Jonathan Cameron
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=20180415204855.4393fbd2@archlinux \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=gregkh@linuxfoundation.org \
--cc=hernan@vanguardiasur.com.ar \
--cc=joe@perches.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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.