public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Tomasz Duszynski <tduszyns@gmail.com>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org,
	Vincent Pelletier <plr.vincent@gmail.com>
Subject: Re: [PATCH v1] iio: adc: intel_mrfld_adc: Add Basin Cove ADC driver
Date: Sun, 24 Mar 2019 12:22:44 +0000	[thread overview]
Message-ID: <20190324122244.484b6dfb@archlinux> (raw)
In-Reply-To: <20190319212507.GM9224@smile.fi.intel.com>

On Tue, 19 Mar 2019 23:25:07 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> On Tue, Mar 19, 2019 at 08:02:15PM +0100, Tomasz Duszynski wrote:
> > On Tue, Mar 19, 2019 at 12:37:28AM +0200, Andy Shevchenko wrote:  
> > > On Mon, Mar 18, 2019 at 09:52:42PM +0100, Tomasz Duszynski wrote:  
> > > > On Mon, Mar 18, 2019 at 12:51:03PM +0300, Andy Shevchenko wrote:  
> 
> > > > > +#include <linux/iio/iio.h>
> > > > > +#include <linux/iio/driver.h>
> > > > > +#include <linux/iio/machine.h>  
> 
> > > > Alphabetical order is preferred.  
> > >
> > > Ah, you meant iio.h vs. driver.h?
> > >  
> > 
> > Yes.  
> 
> It won't compile in alphabetical order.

That's a little worrying as this should definitely not be order dependant.
What was the error? 

Ah, I'm guessing struct iio_dev not defined.
If you would like to put a patch in to add that forward definition in driver.h
that would be great.  Its an omission rather than intentional.

Any chance of getting the whole MFD including this buildable with COMPILE_TEST?
Otherwise coverage likely to be somewhat reduced (I probably won't build it
normally for starters!)

Jonathan

> 
> > > > > +	u8 buf[2];
> > > > > +	int ret;  
> > >  
> > > > > +	ret = regmap_bulk_read(regmap, chan->address, buf, 2);
> > > > > +	if (ret)
> > > > > +		goto done;
> > > > > +
> > > > > +	*result = (buf[0] << 8) | buf[1];  
> > > >
> > > > be/le16_to_cpu() will do it for you.  
> > >
> > > I think get_unaligned_le16() will be better here. Otherwise we need to define
> > > __le16 variable and cast around it.
> > >  
> > 
> > I was thinking about be16_to_cpu(*(__be16 *)buf).
> > Given this is local array and you do not do any pointer arithmetic
> > before casting I would be surprised if that caused unaligned access.  
> 
> Explicit casting to bitwise types seems weird to me, that's why get_unaligned looks better.
> And no, there is no unaligned access per se.
> 


  reply	other threads:[~2019-03-24 12:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18  9:51 [PATCH v1] iio: adc: intel_mrfld_adc: Add Basin Cove ADC driver Andy Shevchenko
2019-03-18 20:52 ` Tomasz Duszynski
2019-03-18 22:37   ` Andy Shevchenko
2019-03-19 19:02     ` Tomasz Duszynski
2019-03-19 21:25       ` Andy Shevchenko
2019-03-24 12:22         ` Jonathan Cameron [this message]
2019-03-26 13:39           ` 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=20190324122244.484b6dfb@archlinux \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=plr.vincent@gmail.com \
    --cc=pmeerw@pmeerw.net \
    --cc=tduszyns@gmail.com \
    /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