From: Lee Jones Date: Fri, 10 Jul 2015 07:45:35 +0000 (+0100) Subject: regulator: pwm-regulator: Fix 'used uninitialized' warning X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b343e08f3c5623d12829ad4965dd4c4e50f86fa2;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git regulator: pwm-regulator: Fix 'used uninitialized' warning drivers/regulator/pwm-regulator.c: In function 'pwm_regulator_init_table': drivers/regulator/pwm-regulator.c:172:14: warning: 'length' is used uninitialized in this function [-Wuninitialized] if ((length < sizeof(*duty_cycle_table)) || ^ Reported-by: kbuild test robot Signed-off-by: Lee Jones Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c index a4c2ce92d41f..331b85148680 100644 --- a/drivers/regulator/pwm-regulator.c +++ b/drivers/regulator/pwm-regulator.c @@ -163,7 +163,7 @@ static int pwm_regulator_init_table(struct platform_device *pdev, { struct device_node *np = pdev->dev.of_node; struct pwm_voltages *duty_cycle_table; - int length; + int length = 0; int ret; of_find_property(np, "voltage-table", &length);