Skip to content

Commit 4448195

Browse files
nathanchancethierryreding
authored andcommitted
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: ClangBuiltLinux/linux#400 Signed-off-by: Nathan Chancellor <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 347ab94 commit 4448195

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pwm/pwm-img.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static int img_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
123123
} else if (mul <= max_timebase * 512) {
124124
div = PWM_CTRL_CFG_SUB_DIV0_DIV1;
125125
timebase = DIV_ROUND_UP(mul, 512);
126-
} else if (mul > max_timebase * 512) {
126+
} else {
127127
dev_err(chip->dev,
128128
"failed to configure timebase steps/divider value\n");
129129
return -EINVAL;

0 commit comments

Comments
 (0)