mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mfd: fix check on unsigned in twl4030_configure_resource()
@ 2009-10-21 12:11 Roel Kluin
  2009-10-21 12:06 ` Amit Kucheria
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-10-21 12:11 UTC (permalink / raw)
  To: Andrew Morton, amit.kucheria, sameo, LKML

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?

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	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-21 12:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-21 12:11 [PATCH] mfd: fix check on unsigned in twl4030_configure_resource() Roel Kluin
2009-10-21 12:06 ` Amit Kucheria

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®