regulator: pwm-regulator: Fix 'used uninitialized' warning
authorLee Jones <lee.jones@linaro.org>
Fri, 10 Jul 2015 07:45:35 +0000 (08:45 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 10 Jul 2015 18:34:06 +0000 (19:34 +0100)
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 <fengguang.wu@intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/pwm-regulator.c

index a4c2ce92d41ff4c6fdcf6fdfcd173a6ad15a3afd..331b8514868055e29fd10ec50206ed5fe77e5009 100644 (file)
@@ -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);