提交 f65e9eac 编写于 作者: A Arnd Bergmann 提交者: Samuel Ortiz

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: NArnd Bergmann <arnd@arndb.de>
Reviewed-by: NPeter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: NAmit Kucheria <amit.kucheria@linaro.org>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: "Kristo, Tero" <t-kristo@ti.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 0a8c290a
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册