From f65e9eacfad60cd05d1bac7defb6ff6b50dcfb5b Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Fri, 25 Jan 2013 14:14:26 +0000 Subject: [PATCH] mfd: twl4030: Don't warn about uninitialized return code If the twl4030_write_script function gets called with a zero length argument, its return value does not get set. We know that all scripts have a nonzero length, but returning an error in case they ever do is probably appropriate. Without this patch, building omap2plus_defconfig results in: drivers/mfd/twl4030-power.c: In function 'load_twl4030_script': drivers/mfd/twl4030-power.c:414:5: error: 'err' may be used uninitialized in this function Signed-off-by: Arnd Bergmann Reviewed-by: Peter Ujfalusi Reviewed-by: Amit Kucheria Cc: Kevin Hilman Cc: "Kristo, Tero" Signed-off-by: Samuel Ortiz --- drivers/mfd/twl4030-power.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index 4dae241e5017..dd362c1078e1 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c @@ -159,7 +159,7 @@ static int twl4030_write_script_ins(u8 address, u16 pmb_message, static int twl4030_write_script(u8 address, struct twl4030_ins *script, int len) { - int err; + int err = -EINVAL; for (; len; len--, address++, script++) { if (len == 1) { -- GitLab