aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl4030-power.c
diff options
context:
space:
mode:
authorAmit Kucheria <amit.kucheria@verdurent.com>2009-10-21 07:49:22 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2009-12-13 13:21:30 -0500
commit53cf9a605d75877550c1b9793d7e994401d08eb7 (patch)
tree2915a777055177360eb45e0097ca2b9bfda17f00 /drivers/mfd/twl4030-power.c
parent3c684e84d1ab810764c7f509aed74a5c48c590ad (diff)
mfd: Fix more undefined twl4030-power resconfig value checks
Based on Aaro's previous fix, this needs to be fixed for the newly added remap_off and remap_sleep resources as well. 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 Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/twl4030-power.c')
-rw-r--r--drivers/mfd/twl4030-power.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index 9f98c36273d8..3048f18e0419 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -398,12 +398,12 @@ static int __init twl4030_configure_resource(struct twl4030_resconfig *rconfig)
398 return err; 398 return err;
399 } 399 }
400 400
401 if (rconfig->remap_off >= 0) { 401 if (rconfig->remap_off != TWL4030_RESCONFIG_UNDEF) {
402 remap &= ~OFF_STATE_MASK; 402 remap &= ~OFF_STATE_MASK;
403 remap |= rconfig->remap_off << OFF_STATE_SHIFT; 403 remap |= rconfig->remap_off << OFF_STATE_SHIFT;
404 } 404 }
405 405
406 if (rconfig->remap_sleep >= 0) { 406 if (rconfig->remap_sleep != TWL4030_RESCONFIG_UNDEF) {
407 remap &= ~SLEEP_STATE_MASK; 407 remap &= ~SLEEP_STATE_MASK;
408 remap |= rconfig->remap_off << SLEEP_STATE_SHIFT; 408 remap |= rconfig->remap_off << SLEEP_STATE_SHIFT;
409 } 409 }