devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: "Sa, Nuno" <Nuno.Sa@analog.com>
Cc: linux-iio <linux-iio@vger.kernel.org>,
	devicetree <devicetree@vger.kernel.org>,
	Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	"Ardelean, Alexandru" <alexandru.Ardelean@analog.com>,
	"Hennerich, Michael" <Michael.Hennerich@analog.com>
Subject: Re: [PATCH v3 5/6] iio: imu: Add support for adis16475
Date: Wed, 1 Apr 2020 19:24:59 +0300	[thread overview]
Message-ID: <CAHp75VddBgGtBf=3yNs331EU6HQgL-Aq7tmf+dG3Z9W-d0hdNQ@mail.gmail.com> (raw)
In-Reply-To: <BN6PR03MB33475E91FA8665937E8F3AE599C90@BN6PR03MB3347.namprd03.prod.outlook.com>

On Wed, Apr 1, 2020 at 5:18 PM Sa, Nuno <Nuno.Sa@analog.com> wrote:
>
> > From: Andy Shevchenko <andy.shevchenko@gmail.com>
> > Sent: Mittwoch, 1. April 2020 16:06
> > To: Sa, Nuno <Nuno.Sa@analog.com>
> > Cc: linux-iio <linux-iio@vger.kernel.org>; devicetree
> > <devicetree@vger.kernel.org>; Jonathan Cameron <jic23@kernel.org>;
> > Hartmut Knaack <knaack.h@gmx.de>; Lars-Peter Clausen <lars@metafoo.de>;
> > Peter Meerwald-Stadler <pmeerw@pmeerw.net>; Rob Herring
> > <robh+dt@kernel.org>; Mark Rutland <mark.rutland@arm.com>; Ardelean,
> > Alexandru <alexandru.Ardelean@analog.com>; Hennerich, Michael
> > <Michael.Hennerich@analog.com>
> > Subject: Re: [PATCH v3 5/6] iio: imu: Add support for adis16475
> >
> > On Wed, Apr 1, 2020 at 4:27 PM Sa, Nuno <Nuno.Sa@analog.com> wrote:
> > > > On Wed, Apr 1, 2020 at 10:13 AM Sa, Nuno <Nuno.Sa@analog.com>
> > wrote:
> > > > > > On Tue, Mar 31, 2020 at 2:49 PM Nuno Sá <nuno.sa@analog.com>
> > wrote:

...

> > > Well, I can remove the 7. I honestly took it from another driver and I guess
> > the idea
> > > is to make explicit that 7 is not supported. Since this is a 3 bit field and the
> > datasheet
> > > does not state this directly.
> > >
> > > As for the >=0, I prefer to have either as is or >0 since we don't really need to
> > check the
> > > index 0. If 1 fails, then we will use 0 either way...
> >
> > It makes sense to check to get better optimization (and increased readability).
> > Look for this
> >
> > i = ARRAY_SIZE(...);
> >
> > while (i--) {
> >  ...
> > }
> >
> > It's much better to read and understand.
>
> Well, about the readability it's a bit subjective . It depends who is
> reading the code. Just curious, how would you get better optimization
> by doing >=0 instead of > 0?

Feel the difference while (i--) vs. while (--i > 0).
The latter one is a bit unusual.

> Either way, I don’t have any strong feeling about this so I can do as
> you suggest.



-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2020-04-01 16:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-31 11:48 [PATCH v3 0/6] Support ADIS16475 and similar IMUs Nuno Sá
2020-03-31 11:48 ` [PATCH v3 1/6] iio: imu: adis: Add Managed device functions Nuno Sá
2020-04-04 16:24   ` Jonathan Cameron
2020-03-31 11:48 ` [PATCH v3 2/6] iio: imu: adis: Add irq mask variable Nuno Sá
2020-03-31 17:40   ` Andy Shevchenko
2020-04-01  7:22     ` Sa, Nuno
2020-04-01 10:27       ` Andy Shevchenko
2020-04-01 13:18         ` Sa, Nuno
2020-03-31 11:48 ` [PATCH v3 3/6] iio: adis: Add adis_update_bits() APIs Nuno Sá
2020-03-31 17:41   ` Andy Shevchenko
2020-04-01  7:14     ` Sa, Nuno
2020-03-31 11:48 ` [PATCH v3 4/6] iio: adis: Support different burst sizes Nuno Sá
2020-03-31 11:48 ` [PATCH v3 5/6] iio: imu: Add support for adis16475 Nuno Sá
2020-03-31 18:15   ` Andy Shevchenko
2020-04-01  7:13     ` Sa, Nuno
2020-04-01 10:22       ` Andy Shevchenko
2020-04-01 13:27         ` Sa, Nuno
2020-04-01 14:06           ` Andy Shevchenko
2020-04-01 14:18             ` Sa, Nuno
2020-04-01 16:24               ` Andy Shevchenko [this message]
2020-04-04 16:05           ` Jonathan Cameron
2020-04-04 16:01         ` Jonathan Cameron
2020-03-31 11:48 ` [PATCH v3 6/6] dt-bindings: iio: Add adis16475 documentation Nuno Sá

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='CAHp75VddBgGtBf=3yNs331EU6HQgL-Aq7tmf+dG3Z9W-d0hdNQ@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=Nuno.Sa@analog.com \
    --cc=alexandru.Ardelean@analog.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@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;
as well as URLs for NNTP newsgroup(s).