提交 53cf9a60 编写于 作者: A Amit Kucheria 提交者: Samuel Ortiz

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: NAmit Kucheria <amit.kucheria@verdurent.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 3c684e84
......@@ -398,12 +398,12 @@ static int __init twl4030_configure_resource(struct twl4030_resconfig *rconfig)
return err;
}
if (rconfig->remap_off >= 0) {
if (rconfig->remap_off != TWL4030_RESCONFIG_UNDEF) {
remap &= ~OFF_STATE_MASK;
remap |= rconfig->remap_off << OFF_STATE_SHIFT;
}
if (rconfig->remap_sleep >= 0) {
if (rconfig->remap_sleep != TWL4030_RESCONFIG_UNDEF) {
remap &= ~SLEEP_STATE_MASK;
remap |= rconfig->remap_off << SLEEP_STATE_SHIFT;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册