From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>,
Mike Rapoport <mike@compulab.co.il>,
eric.y.miao@gmail.com, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] regulator: fix calculation of voltage range in da9034_set_ldo12_voltage()
Date: Tue, 25 Aug 2009 19:39:56 +0100 [thread overview]
Message-ID: <20090825183955.GA2724@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <4A93EA28.9050105@gmail.com>
On Tue, Aug 25, 2009 at 03:42:00PM +0200, Roel Kluin wrote:
> For val to be greater than 7 or less than 20 is logically always true.
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Looks good to me but CCing in Eric and Mike just in case the intent of
the code was something other than the new version.
> diff --git a/drivers/regulator/da903x.c b/drivers/regulator/da903x.c
> index b8b89ef..2d9bde5 100644
> --- a/drivers/regulator/da903x.c
> +++ b/drivers/regulator/da903x.c
> @@ -278,7 +278,7 @@ static int da9034_set_ldo12_voltage(struct regulator_dev *rdev,
> }
>
> val = (min_uV - info->min_uV + info->step_uV - 1) / info->step_uV;
> - val = (val > 7 || val < 20) ? 8 : val - 12;
> + val = (val > 7 && val < 20) ? 8 : val - 12;
> val <<= info->vol_shift;
> mask = ((1 << info->vol_nbits) - 1) << info->vol_shift;
>
parent reply other threads:[~2009-08-25 18:39 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <4A93EA28.9050105@gmail.com>]
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=20090825183955.GA2724@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=akpm@linux-foundation.org \
--cc=eric.y.miao@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
--cc=mike@compulab.co.il \
--cc=roel.kluin@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