public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: Fix test of unsigned in twl4030_configure_resource()
@ 2009-12-16 13:41 Roel Kluin
  2009-12-16 13:44 ` Roel Kluin
  0 siblings, 1 reply; 3+ messages in thread
From: Roel Kluin @ 2009-12-16 13:41 UTC (permalink / raw)
  To: Samuel Ortiz, Andrew Morton, LKML, amit.kucheria

devgroup is unsigned so the test did not work.

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

diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index d423e0c..f207e28 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,

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mfd: Fix test of unsigned in twl4030_configure_resource()
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Roel Kluin @ 2009-12-16 13:44 UTC (permalink / raw)
  To: Roel Kluin; +Cc: Samuel Ortiz, Andrew Morton, LKML, amit.kucheria

devgroup is unsigned so the test did not work.

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;
 	}

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mfd: Fix test of unsigned in twl4030_configure_resource()
  2009-12-16 13:44 ` Roel Kluin
@ 2010-01-05 19:23   ` Samuel Ortiz
  0 siblings, 0 replies; 3+ messages in thread
From: Samuel Ortiz @ 2010-01-05 19:23 UTC (permalink / raw)
  To: Roel Kluin; +Cc: Andrew Morton, LKML, amit.kucheria

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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-01-05 19:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox