summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@nokia.com>2009-10-19 21:24:02 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2009-12-13 19:21:25 +0100
commit56baa667973e53d6d38af2ad3731d558566d818b (patch)
treecacc84313e48bb592adb76fe6f28e790e5ab942c /drivers
parentb4ead61e570d7b7bcf20a5a1733dd0bc37236c99 (diff)
downloadlinux-56baa667973e53d6d38af2ad3731d558566d818b.tar.gz
linux-56baa667973e53d6d38af2ad3731d558566d818b.tar.bz2
linux-56baa667973e53d6d38af2ad3731d558566d818b.zip
mfd: fix undefined twl4030-power resconfig value checks
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 drivers/mfd/twl4030-power.c:358: warning: comparison is always true due to limited range of data type drivers/mfd/twl4030-power.c:363: warning: comparison is always true due to limited range of data type Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mfd/twl4030-power.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index 3e41e0c0e4c6..9f98c36273d8 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -352,7 +352,7 @@ static int __init twl4030_configure_resource(struct twl4030_resconfig *rconfig)
return err;
}
- if (rconfig->devgroup >= 0) {
+ if (rconfig->devgroup != TWL4030_RESCONFIG_UNDEF) {
grp &= ~DEV_GRP_MASK;
grp |= rconfig->devgroup << DEV_GRP_SHIFT;
err = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
@@ -372,12 +372,12 @@ static int __init twl4030_configure_resource(struct twl4030_resconfig *rconfig)
return err;
}
- if (rconfig->type >= 0) {
+ if (rconfig->type != TWL4030_RESCONFIG_UNDEF) {
type &= ~TYPE_MASK;
type |= rconfig->type << TYPE_SHIFT;
}
- if (rconfig->type2 >= 0) {
+ if (rconfig->type2 != TWL4030_RESCONFIG_UNDEF) {
type &= ~TYPE2_MASK;
type |= rconfig->type2 << TYPE2_SHIFT;
}