linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@cam.ac.uk>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Michael Hennerich <michael.hennerich@analog.com>,
	linux-iio@vger.kernel.org,
	device-drivers-devel@blackfin.uclinux.org, drivers@analog.com
Subject: Re: [RFC 1/2] staging:iio: Do not use bitmasks for channel info addresses
Date: Fri, 21 Oct 2011 14:24:39 +0100	[thread overview]
Message-ID: <4EA17297.2040700@cam.ac.uk> (raw)
In-Reply-To: <1319199855-24834-1-git-send-email-lars@metafoo.de>

On 10/21/11 13:24, Lars-Peter Clausen wrote:
> Currently the iio framework uses bitmasks for the address field of channel info
> attributes. This is for historical reasons and no longer required since it will
> only ever query a single info attribute at once. This patch changes the code to
> use the non-shifted iio_chan_info_enum values for the info attribute address.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> 
> ---
> Runtime tested for some of th DACs. Others only compile tested.
> 
> I did not change the read_raw, write_raw and write_raw_get_fmt callbacks to
> use iio_chan_info_enum as the type for the mask attribute in this patch. But we
> probably want to do this at some point.
Agreed.  Should probably stop calling it mask as well :)

Still that can validly be a follow up patch if you don't want to
do it in here.

I have vaguely wondered in those functions whether it makes
sense to mash the shared and separate variants together
in the handling.  Other than lazy coding I can't actually
see when this would hurt and it would make the kernel query
interface simpler.  Hence your MASK macro in the next patch would
take the enum value and double it + add one or not to say if
it is shared or not.

One for a follow up patch I think.  Fiddly bit will be verifying
every driver does the right thing.  I suspect I for one may
have take advantage of the separation of these in a few
drivers.

Can't conceive of any reason what you have here could cause
any issues in drivers. Let us push this out asap.  I've just pulled
it into the github master branch.

I've tested on everything I have wired up today. max1363 (couple
of parts), tsl2563 and lis3l02dq.

Acked-by: Jonathan Cameron <jic23@cam.ac.uk>

Nice work cleanup.  Got to love the stupid code you can end up
with as it evolves sometimes.

Jonathan

  parent reply	other threads:[~2011-10-21 13:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-21 12:24 [RFC 1/2] staging:iio: Do not use bitmasks for channel info addresses Lars-Peter Clausen
2011-10-21 12:24 ` [RFC PATCH 2/2] staging:iio: Introduce IIO_CHAN_INFO_*_MASK Lars-Peter Clausen
2011-10-21 13:08   ` Jonathan Cameron
2011-10-21 13:24 ` Jonathan Cameron [this message]
2011-10-21 13:50   ` [RFC 1/2] staging:iio: Do not use bitmasks for channel info addresses Lars-Peter Clausen
2011-10-21 14:09     ` 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=4EA17297.2040700@cam.ac.uk \
    --to=jic23@cam.ac.uk \
    --cc=device-drivers-devel@blackfin.uclinux.org \
    --cc=drivers@analog.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=michael.hennerich@analog.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;
as well as URLs for NNTP newsgroup(s).