linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald <pmeerw@pmeerw.net>,
	Jonathan Cameron <jic23@cam.ac.uk>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH 2/5] iio: Introduce iio_validate_scan_mask_onehot
Date: Sun, 08 Jul 2012 09:58:55 +0100	[thread overview]
Message-ID: <4FF94BCF.5090205@kernel.org> (raw)
In-Reply-To: <4FF19E69.9040009@metafoo.de>

On 07/02/2012 02:13 PM, Lars-Peter Clausen wrote:
> On 07/02/2012 02:52 PM, Peter Meerwald wrote:
>>
>>> Add a helper function for validating a scan mask for devices where at most one
>>> channel may be selected at a time. This is a common case among devices which
>>> have scan mask restrictions so it makes sense to provide this function in the
>>> core.
>>
>> personally, would find iio_validate_scan_mask_atmost_one clearer than
>> iio_validate_scan_mask_onehot, but it is a bit longer also
> 
> I think the code can even be changed to be more strict and just check if
> bitmap_weight == 1. A mask is only validating after enabling a channel and
> not after disabling it, so there will always be at least one bit set when
> the validate function is called.
Any of the above is fine with me.  I like this patch set as is, but if
you want to change things feel free!  Either way let me know.
> 
> - Lars
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2012-07-08  8:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-02 12:44 [PATCH 1/5] iio: Add callback to check whether a scan mask is valid Lars-Peter Clausen
2012-07-02 12:44 ` [PATCH 2/5] iio: Introduce iio_validate_scan_mask_onehot Lars-Peter Clausen
2012-07-02 12:52   ` Peter Meerwald
2012-07-02 13:13     ` Lars-Peter Clausen
2012-07-08  8:58       ` Jonathan Cameron [this message]
2012-07-02 12:44 ` [PATCH 3/5] staging:iio:ad7192: Use iio_validate_scan_mask_onehot Lars-Peter Clausen
2012-07-02 12:44 ` [PATCH 4/5] staging:iio:ad7793: " Lars-Peter Clausen
2012-07-02 12:44 ` [PATCH 5/5] staging:iio:ade7758: " Lars-Peter Clausen

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=4FF94BCF.5090205@kernel.org \
    --to=jic23@kernel.org \
    --cc=jic23@cam.ac.uk \
    --cc=lars@metafoo.de \
    --cc=linux-iio@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 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).