diff options
author | Nathan Chancellor <natechancellor@gmail.com> | 2019-03-07 17:36:28 -0500 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2019-03-20 07:29:22 -0400 |
commit | 44481955eab7029b58c956d64485fece6f12a53f (patch) | |
tree | 8402b00fd5481f9973bcd60b3ecc95d3a0385faa | |
parent | 347ab9480313737c0f1aaa08e8f2e1a791235535 (diff) |
pwm: img: Turn final 'else if' into 'else' in img_pwm_config
When building with -Wsometimes-uninitialized, Clang warns:
drivers/pwm/pwm-img.c:126:13: error: variable 'timebase' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
The final else if functions as an else; make that explicit so that Clang
understands that timebase cannot be used uninitialized.
Link: https://github.com/ClangBuiltLinux/linux/issues/400
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
-rw-r--r-- | drivers/pwm/pwm-img.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-img.c b/drivers/pwm/pwm-img.c index 815f5333bb8f..1cc5fbe1e1d3 100644 --- a/drivers/pwm/pwm-img.c +++ b/drivers/pwm/pwm-img.c | |||
@@ -123,7 +123,7 @@ static int img_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, | |||
123 | } else if (mul <= max_timebase * 512) { | 123 | } else if (mul <= max_timebase * 512) { |
124 | div = PWM_CTRL_CFG_SUB_DIV0_DIV1; | 124 | div = PWM_CTRL_CFG_SUB_DIV0_DIV1; |
125 | timebase = DIV_ROUND_UP(mul, 512); | 125 | timebase = DIV_ROUND_UP(mul, 512); |
126 | } else if (mul > max_timebase * 512) { | 126 | } else { |
127 | dev_err(chip->dev, | 127 | dev_err(chip->dev, |
128 | "failed to configure timebase steps/divider value\n"); | 128 | "failed to configure timebase steps/divider value\n"); |
129 | return -EINVAL; | 129 | return -EINVAL; |