From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Pierre Bourdon <delroth@google.com>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
linux-iio@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
devicetree <devicetree@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Daniel Baluta <daniel.baluta@gmail.com>
Subject: Re: [PATCH v3 1/2] iio: light: add driver for bh1730fvc chips
Date: Sat, 3 Mar 2018 16:15:07 +0000 [thread overview]
Message-ID: <20180303161507.2f60345f@archlinux> (raw)
In-Reply-To: <CAHp75VeEXdUMw2Skr=jDjUL+Rz=Xu-0S3Mw-X6MvjAXet974hw@mail.gmail.com>
On Sat, 3 Mar 2018 17:44:44 +0200
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> On Sat, Mar 3, 2018 at 5:37 PM, Jonathan Cameron <jic23@kernel.org> wrote:
> > On Wed, 28 Feb 2018 17:06:09 +0200
> >> On Wed, Feb 28, 2018 at 2:15 AM, Pierre Bourdon <delroth@google.com> wrote:
>
> Better to address even minors before submission.
Absolutely.
>
> >> > + if (itime <= 0 || itime > 255)
> >>
> >> Just side note: Suprisingly how many in_range() implementations we
> >> have in kernel...
> > I guess one of those things that is so simple it's not worth having
> > one true in_range to rule them all ;)
>
> We have already several implementations of the macro.
>
> >> > +static int bh1730_adjust_gain(struct bh1730_data *bh1730)
> >> > +{
> >> > + int visible, ir, highest, gain, ret, i;
> >>
> >> int visible, ir, highest, gain;
> >> unsigned int i;
> >
> > Is there a strong reason for this one that I'm missing?
> > (beyond personal taste!)
>
> First of all, I'm far from being fan of mixing int ret into other
> variable definitions.
>
> unsigned int i OTOH shows explicitly that we have counter which is not
> supposed to be negative.
Given it's specifically indexing over an enum (which can have any definition
it likes) I wouldn't normally care, but fair enough.
>
> int i in most of the cases will work, so, it's a minor. I'm not
> insisting, though having counter variable on separate line is also a
> good thing.
>
> In general, having different things in one line is a bad idea for my opinion.
Agreed.
>
> >> int ret;
>
next prev parent reply other threads:[~2018-03-03 16:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-28 0:15 [PATCH v3 1/2] iio: light: add driver for bh1730fvc chips Pierre Bourdon
2018-02-28 0:15 ` [PATCH v3 2/2] dt-bindings: iio: light: Add bh1730fvc bindings Pierre Bourdon
2018-03-05 22:56 ` Rob Herring
2018-02-28 15:06 ` [PATCH v3 1/2] iio: light: add driver for bh1730fvc chips Andy Shevchenko
2018-03-03 15:37 ` Jonathan Cameron
2018-03-03 15:44 ` Andy Shevchenko
2018-03-03 16:15 ` Jonathan Cameron [this message]
2018-03-03 20:40 ` Pierre Bourdon (delroth)
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=20180303161507.2f60345f@archlinux \
--to=jic23@kernel.org \
--cc=andy.shevchenko@gmail.com \
--cc=daniel.baluta@gmail.com \
--cc=delroth@google.com \
--cc=devicetree@vger.kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pmeerw@pmeerw.net \
--cc=robh+dt@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