pwm: atmel: remove redundant initialization of variable timeout
PATCH 1/1 pwm: atmel: remove redundant initialization of variable timeout
The variable timeout is being initialized with a value that is never read, it is being re-assigned the same value later on. Remove the redundant initialization and keep the latter assignment because it's closer to the use of the variable.
--- drivers/pwm/pwm-atmel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/pwm-atmel.c +1 -1
@@ -271,7 +271,7 @@ static void atmel_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm, bool disable_clk) {struct atmel_pwm_chip *atmel_pwm =to_atmel_pwm_chip (chip); -unsigned long timeout = jiffies +2 *HZ ; +unsigned long timeout;atmel_pwm_wait_nonpending (atmel_pwm, pwm->hwpwm);
Signature · 1 line
2.34.1
Quoted 15 lines · Colin Ian King
The variable timeout is being initialized with a value that is never read, it is being re-assigned the same value later on. Remove the redundant initialization and keep the latter assignment because it's closer to the use of the variable.
Signed-off-by Colin Ian King <[email protected]>--- drivers/pwm/pwm-atmel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pwm/pwm-atmel.c +0
-0
drivers/pwm/pwm-atmel.c static void atmel_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm, · line 276
Quoted 7 lines
drivers/pwm/pwm-atmel.c +1
-1@@ -271,7 +271,7 @@ static void atmel_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm, bool disable_clk) {struct atmel_pwm_chip *atmel_pwm =to_atmel_pwm_chip (chip); -unsigned long timeout = jiffies +2 *HZ ; +unsigned long timeout;atmel_pwm_wait_nonpending (atmel_pwm, pwm->hwpwm);
Did you spot this by using some static checker? If so, maybe attribute it in the commit log?
Thanks
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
Quoted 22 lines · Uwe Kleine-König
Quoted 21 lines · Colin Ian King
The variable timeout is being initialized with a value that is never read, it is being re-assigned the same value later on. Remove the redundant initialization and keep the latter assignment because it's closer to the use of the variable.
Signed-off-by Colin Ian King <[email protected]>--- drivers/pwm/pwm-atmel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pwm/pwm-atmel.c +1
-1@@ -271,7 +271,7 @@ static void atmel_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm, bool disable_clk) {struct atmel_pwm_chip *atmel_pwm =to_atmel_pwm_chip (chip); -unsigned long timeout = jiffies +2 *HZ ; +unsigned long timeout;
Quoted 6 lines
drivers/pwm/pwm-atmel.c static void atmel_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm, · line 276
Quoted 1 line
drivers/pwm/pwm-atmel.c +0
-0atmel_pwm_wait_nonpending (atmel_pwm, pwm->hwpwm);Reviewed-by Uwe Kleine-König <[email protected]>Did you spot this by using some static checker? If so, maybe attribute it in the commit log?
Just clang.
Quoted 4 lines
Thanks
Uwe
Thierry Reding
AppliedQuoted 9 lines · Colin Ian King
The variable timeout is being initialized with a value that is never read, it is being re-assigned the same value later on. Remove the redundant initialization and keep the latter assignment because it's closer to the use of the variable.
Signed-off-by Colin Ian King <[email protected]>--- drivers/pwm/pwm-atmel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Thierry