Commit 413c2a11 authored by Thierry Reding's avatar Thierry Reding

pwm: sun4i: Initialize variables before use

GCC can't always determine that the duty, period and prescaler values
are initialized when returning from sun4i_pwm_calculate(), so help out a
little by initializing them to 0.
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 0c73201c
...@@ -234,9 +234,9 @@ static int sun4i_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, ...@@ -234,9 +234,9 @@ static int sun4i_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
{ {
struct sun4i_pwm_chip *sun4i_pwm = to_sun4i_pwm_chip(chip); struct sun4i_pwm_chip *sun4i_pwm = to_sun4i_pwm_chip(chip);
struct pwm_state cstate; struct pwm_state cstate;
u32 ctrl, duty, period, val; u32 ctrl, duty = 0, period = 0, val;
int ret; int ret;
unsigned int delay_us, prescaler; unsigned int delay_us, prescaler = 0;
unsigned long now; unsigned long now;
bool bypass; bool bypass;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment