mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Jonathan Cameron <jic23@kernel.org>,
	Luis de Bethencourt <luisbg@osg.samsung.com>,
	linux-kernel@vger.kernel.org
Cc: gregkh@linuxfoundation.org, Michael.Hennerich@analog.com,
	knaack.h@gmx.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org,
	devel@driverdev.osuosl.org
Subject: Re: [PATCH v2] staging: iio: ad5933: fix order of cycle conditions
Date: Sat, 11 Jun 2016 19:25:19 +0200	[thread overview]
Message-ID: <575C497F.2080507@metafoo.de> (raw)
In-Reply-To: <d4277886-41b4-e1ea-e015-6e62ac0212de@kernel.org>

On 06/11/2016 06:50 PM, Jonathan Cameron wrote:
> On 01/06/16 20:25, Luis de Bethencourt wrote:
>> Correctly handle the settling time cycles value. The else branch is an
>> impossible condition, > 1022 in the else branch of > 511. Flipping the order.
>>
>> Based on the Table 13 at the bottom of Page 25 of the Data Sheet:
>> http://www.analog.com/media/en/technical-documentation/data-sheets/AD5933.pdf
>>
>> Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
>> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
> While Lars did review, it I'm not seeing an email where he
> gave this tag (my inbox may well have eaten it).
> 
> Lars, could you confirm that you are happy with the
> patch as it now stands.
> 

All good, thanks.

> Certainly looks right to me!
> 
> Thanks, 
> Jonathan
>> ---
>>  drivers/staging/iio/impedance-analyzer/ad5933.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c
>> index 9f43976..170ac98 100644
>> --- a/drivers/staging/iio/impedance-analyzer/ad5933.c
>> +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
>> @@ -444,10 +444,10 @@ static ssize_t ad5933_store(struct device *dev,
>>  		st->settling_cycles = val;
>>  
>>  		/* 2x, 4x handling, see datasheet */
>> -		if (val > 511)
>> -			val = (val >> 1) | (1 << 9);
>> -		else if (val > 1022)
>> +		if (val > 1022)
>>  			val = (val >> 2) | (3 << 9);
>> +		else if (val > 511)
>> +			val = (val >> 1) | (1 << 9);
>>  
>>  		dat = cpu_to_be16(val);
>>  		ret = ad5933_i2c_write(st->client,
>>
> 

  reply	other threads:[~2016-06-11 17:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 19:25 Luis de Bethencourt
2016-06-11 16:50 ` Jonathan Cameron
2016-06-11 17:25   ` Lars-Peter Clausen [this message]
2016-06-11 17:37     ` 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=575C497F.2080507@metafoo.de \
    --to=lars@metafoo.de \
    --cc=Michael.Hennerich@analog.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luisbg@osg.samsung.com \
    --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

all inboxes | Powered by JetHome®