On Wed, Oct 14, 2009 at 03:15:49PM +0300, Aaro Koskinen wrote:The script length cannot be negative. If the length is zero, returnOut of curiosity, which toolchain are you using ? I cross compile my mfd tree
an error.
The patch eliminates the following compiler warning:
for ARM, and I dont get this error...
drivers/mfd/twl4030-power.c: In function 'twl4030_power_init':twl4030_power_init ? Isnt it twl4030_write_script ?
Cheers,
Samuel.
drivers/mfd/twl4030-power.c:151: warning: 'err' may be used uninitialized in this function
drivers/mfd/twl4030-power.c:151: note: 'err' was declared here
Signed-off-by: Aaro Koskinen <aaro.koskinen@xxxxxxxxx>
---
drivers/mfd/twl4030-power.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index d423e0c..eae6cda 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -146,9 +146,9 @@ out:
}
static int __init twl4030_write_script(u8 address, struct twl4030_ins *script,
- int len)
+ unsigned len)
{
- int err;
+ int err = EINVAL;
for (; len; len--, address++, script++) {
if (len == 1) {
--
1.6.0.4