From: Samuel Ortiz <sameo@linux.intel.com>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
amit.kucheria@verdurent.com
Subject: Re: [PATCH] mfd: Fix test of unsigned in twl4030_configure_resource()
Date: Tue, 5 Jan 2010 20:23:02 +0100 [thread overview]
Message-ID: <20100105192227.GJ4274@sortiz.org> (raw)
In-Reply-To: <4B28E42F.9000209@gmail.com>
Hi Roel,
On Wed, Dec 16, 2009 at 02:44:15PM +0100, Roel Kluin wrote:
> devgroup is unsigned so the test did not work.
This one was fixed with commit 56baa667973e53d6d38af2ad3731d558566d818b.
Cheers,
Samuel.
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> Found using coccinelle: http://coccinelle.lip6.fr/
>
> see
> vi arch/arm/mach-omap2/board-rx51-peripherals.c +512
>
> Oops, missed some in previous patch.
>
> Roel
>
> diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
> index d423e0c..cc984a5 100644
> --- a/drivers/mfd/twl4030-power.c
> +++ b/drivers/mfd/twl4030-power.c
> @@ -335,7 +335,7 @@ static int __init twl4030_configure_resource(struct twl4030_resconfig *rconfig)
> return err;
> }
>
> - if (rconfig->devgroup >= 0) {
> + if (rconfig->devgroup != -1) {
> grp &= ~DEVGROUP_MASK;
> grp |= rconfig->devgroup << DEVGROUP_SHIFT;
> err = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
> @@ -355,12 +355,12 @@ static int __init twl4030_configure_resource(struct twl4030_resconfig *rconfig)
> return err;
> }
>
> - if (rconfig->type >= 0) {
> + if (rconfig->type != -1) {
> type &= ~TYPE_MASK;
> type |= rconfig->type << TYPE_SHIFT;
> }
>
> - if (rconfig->type2 >= 0) {
> + if (rconfig->type2 != -1) {
> type &= ~TYPE2_MASK;
> type |= rconfig->type2 << TYPE2_SHIFT;
> }
--
Intel Open Source Technology Centre
http://oss.intel.com/
prev parent reply other threads:[~2010-01-05 19:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-16 13:41 [PATCH] mfd: Fix test of unsigned in twl4030_configure_resource() Roel Kluin
2009-12-16 13:44 ` Roel Kluin
2010-01-05 19:23 ` 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=20100105192227.GJ4274@sortiz.org \
--to=sameo@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=amit.kucheria@verdurent.com \
--cc=linux-kernel@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.