From: Samuel Ortiz <sameo@linux.intel.com>
To: Amit Kucheria <amit.kucheria@verdurent.com>
Cc: List Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mfd: fix more undefined twl4030-power resconfig value checks
Date: Thu, 22 Oct 2009 00:26:28 +0200 [thread overview]
Message-ID: <20091021222627.GD17796@sortiz.org> (raw)
In-Reply-To: <1256125762-10069-1-git-send-email-amit.kucheria@verdurent.com>
On Wed, Oct 21, 2009 at 02:49:22PM +0300, Amit Kucheria wrote:
> Based on Aaro's previous fix, this needs to be fixed for the newly added
> remap_off and remap_sleep resources as well.
>
> The code tries to skip values initialized with -1, but since the values
> are unsigned the comparison is always true.
>
> The patch eliminates the following compiler warnings:
>
> drivers/mfd/twl4030-power.c: In function 'twl4030_configure_resource':
> drivers/mfd/twl4030-power.c:338: warning: comparison is always true due to
> limited range of data type
Thanks Amit, patch applied.
Cheers,
Samuel.
> Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com>
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> ---
> drivers/mfd/twl4030-power.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
> index 9f98c36..3048f18 100644
> --- a/drivers/mfd/twl4030-power.c
> +++ b/drivers/mfd/twl4030-power.c
> @@ -398,12 +398,12 @@ static int __init twl4030_configure_resource(struct twl4030_resconfig *rconfig)
> return err;
> }
>
> - if (rconfig->remap_off >= 0) {
> + if (rconfig->remap_off != TWL4030_RESCONFIG_UNDEF) {
> remap &= ~OFF_STATE_MASK;
> remap |= rconfig->remap_off << OFF_STATE_SHIFT;
> }
>
> - if (rconfig->remap_sleep >= 0) {
> + if (rconfig->remap_sleep != TWL4030_RESCONFIG_UNDEF) {
> remap &= ~SLEEP_STATE_MASK;
> remap |= rconfig->remap_off << SLEEP_STATE_SHIFT;
> }
> --
> 1.6.3.3
>
--
Intel Open Source Technology Centre
http://oss.intel.com/
prev parent reply other threads:[~2009-10-21 22:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-21 11:49 [PATCH] mfd: fix more undefined twl4030-power resconfig value checks Amit Kucheria
2009-10-21 22:26 ` Samuel Ortiz [this message]
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=20091021222627.GD17796@sortiz.org \
--to=sameo@linux.intel.com \
--cc=amit.kucheria@verdurent.com \
--cc=linux-kernel@vger.kernel.org \
/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