From: Amit Kucheria <amit.kucheria@verdurent.com>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
sameo@linux.intel.com, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mfd: fix check on unsigned in twl4030_configure_resource()
Date: Wed, 21 Oct 2009 15:06:42 +0300 [thread overview]
Message-ID: <37786d4b0910210506s8ab8556yf99c96519e35e1e2@mail.gmail.com> (raw)
In-Reply-To: <4ADEFA54.1090005@gmail.com>
On Wed, Oct 21, 2009 at 3:11 PM, Roel Kluin <roel.kluin@gmail.com> wrote:
> struct twl4030_resconfig members devgroup, type and type2 are
> unsigned.
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> `git grep devgroup' and notice that these are initialized to -1 in
> arch/arm/mach-omap2/board-rx51-peripherals.c:383-397
>
> Is this the right fix?
Yes it is. Aaro beat you to it though [1] :)
Regards,
Amit
[1]. http://git.kernel.org/?p=linux/kernel/git/sameo/mfd-2.6.git;a=commitdiff;h=86db38dffd5903e2fbb4268e46fd8a07a5ceb8ac
> 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;
> }
>
prev parent reply other threads:[~2009-10-21 12:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-21 12:11 Roel Kluin
2009-10-21 12:06 ` Amit Kucheria [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=37786d4b0910210506s8ab8556yf99c96519e35e1e2@mail.gmail.com \
--to=amit.kucheria@verdurent.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=roel.kluin@gmail.com \
--cc=sameo@linux.intel.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
all inboxes | Powered by JetHome®