All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pwm: atmel: remove redundant initialization of variable timeout
@ 2021-12-10  0:22 ` Colin Ian King
  0 siblings, 0 replies; 8+ messages in thread
From: Colin Ian King @ 2021-12-10  0:22 UTC (permalink / raw)
  To: Claudiu Beznea, Thierry Reding, Uwe Kleine-König, Lee Jones,
	Nicolas Ferre, Alexandre Belloni, Ludovic Desroches,
	linux-arm-kernel, linux-pwm
  Cc: kernel-janitors, linux-kernel

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 <colin.i.king@gmail.com>
---
 drivers/pwm/pwm-atmel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c
index 98b34ea9f38e..8e00a4286145 100644
--- a/drivers/pwm/pwm-atmel.c
+++ b/drivers/pwm/pwm-atmel.c
@@ -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);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] pwm: atmel: remove redundant initialization of variable timeout
@ 2021-12-10  0:22 ` Colin Ian King
  0 siblings, 0 replies; 8+ messages in thread
From: Colin Ian King @ 2021-12-10  0:22 UTC (permalink / raw)
  To: Claudiu Beznea, Thierry Reding, Uwe Kleine-König, Lee Jones,
	Nicolas Ferre, Alexandre Belloni, Ludovic Desroches,
	linux-arm-kernel, linux-pwm
  Cc: kernel-janitors, linux-kernel

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 <colin.i.king@gmail.com>
---
 drivers/pwm/pwm-atmel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c
index 98b34ea9f38e..8e00a4286145 100644
--- a/drivers/pwm/pwm-atmel.c
+++ b/drivers/pwm/pwm-atmel.c
@@ -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);
 
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] pwm: atmel: remove redundant initialization of variable timeout
  2021-12-10  0:22 ` Colin Ian King
@ 2021-12-10  7:45   ` Uwe Kleine-König
  -1 siblings, 0 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2021-12-10  7:45 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Claudiu Beznea, Thierry Reding, Lee Jones, Nicolas Ferre,
	Alexandre Belloni, Ludovic Desroches, linux-arm-kernel,
	linux-pwm, kernel-janitors, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1323 bytes --]

On Fri, Dec 10, 2021 at 12:22:50AM +0000, Colin Ian King wrote:
> 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 <colin.i.king@gmail.com>
> ---
>  drivers/pwm/pwm-atmel.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c
> index 98b34ea9f38e..8e00a4286145 100644
> --- a/drivers/pwm/pwm-atmel.c
> +++ b/drivers/pwm/pwm-atmel.c
> @@ -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);

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Did you spot this by using some static checker? If so, maybe attribute
it in the commit log?

Thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] pwm: atmel: remove redundant initialization of variable timeout
@ 2021-12-10  7:45   ` Uwe Kleine-König
  0 siblings, 0 replies; 8+ messages in thread
From: Uwe Kleine-König @ 2021-12-10  7:45 UTC (permalink / raw)
  To: Colin Ian King
  Cc: linux-pwm, Alexandre Belloni, kernel-janitors, linux-kernel,
	Ludovic Desroches, Thierry Reding, Lee Jones, Claudiu Beznea,
	linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1323 bytes --]

On Fri, Dec 10, 2021 at 12:22:50AM +0000, Colin Ian King wrote:
> 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 <colin.i.king@gmail.com>
> ---
>  drivers/pwm/pwm-atmel.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c
> index 98b34ea9f38e..8e00a4286145 100644
> --- a/drivers/pwm/pwm-atmel.c
> +++ b/drivers/pwm/pwm-atmel.c
> @@ -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);

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Did you spot this by using some static checker? If so, maybe attribute
it in the commit log?

Thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] pwm: atmel: remove redundant initialization of variable timeout
  2021-12-10  7:45   ` Uwe Kleine-König
@ 2021-12-10  9:02     ` Colin King (gmail)
  -1 siblings, 0 replies; 8+ messages in thread
From: Colin King (gmail) @ 2021-12-10  9:02 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Claudiu Beznea, Thierry Reding, Lee Jones, Nicolas Ferre,
	Alexandre Belloni, Ludovic Desroches, linux-arm-kernel,
	linux-pwm, kernel-janitors, linux-kernel

On 10/12/2021 07:45, Uwe Kleine-König wrote:
> On Fri, Dec 10, 2021 at 12:22:50AM +0000, Colin Ian King wrote:
>> 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 <colin.i.king@gmail.com>
>> ---
>>   drivers/pwm/pwm-atmel.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c
>> index 98b34ea9f38e..8e00a4286145 100644
>> --- a/drivers/pwm/pwm-atmel.c
>> +++ b/drivers/pwm/pwm-atmel.c
>> @@ -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);
> 
> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> Did you spot this by using some static checker? If so, maybe attribute
> it in the commit log?

Just clang.

> 
> Thanks
> Uwe
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] pwm: atmel: remove redundant initialization of variable timeout
@ 2021-12-10  9:02     ` Colin King (gmail)
  0 siblings, 0 replies; 8+ messages in thread
From: Colin King (gmail) @ 2021-12-10  9:02 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-pwm, Alexandre Belloni, kernel-janitors, linux-kernel,
	Ludovic Desroches, Thierry Reding, Lee Jones, Claudiu Beznea,
	linux-arm-kernel

On 10/12/2021 07:45, Uwe Kleine-König wrote:
> On Fri, Dec 10, 2021 at 12:22:50AM +0000, Colin Ian King wrote:
>> 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 <colin.i.king@gmail.com>
>> ---
>>   drivers/pwm/pwm-atmel.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c
>> index 98b34ea9f38e..8e00a4286145 100644
>> --- a/drivers/pwm/pwm-atmel.c
>> +++ b/drivers/pwm/pwm-atmel.c
>> @@ -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);
> 
> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> Did you spot this by using some static checker? If so, maybe attribute
> it in the commit log?

Just clang.

> 
> Thanks
> Uwe
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] pwm: atmel: remove redundant initialization of variable timeout
  2021-12-10  0:22 ` Colin Ian King
@ 2022-02-24 12:54   ` Thierry Reding
  -1 siblings, 0 replies; 8+ messages in thread
From: Thierry Reding @ 2022-02-24 12:54 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Claudiu Beznea, Uwe Kleine-König, Lee Jones, Nicolas Ferre,
	Alexandre Belloni, Ludovic Desroches, linux-arm-kernel,
	linux-pwm, kernel-janitors, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 501 bytes --]

On Fri, Dec 10, 2021 at 12:22:50AM +0000, Colin Ian King wrote:
> 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 <colin.i.king@gmail.com>
> ---
>  drivers/pwm/pwm-atmel.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] pwm: atmel: remove redundant initialization of variable timeout
@ 2022-02-24 12:54   ` Thierry Reding
  0 siblings, 0 replies; 8+ messages in thread
From: Thierry Reding @ 2022-02-24 12:54 UTC (permalink / raw)
  To: Colin Ian King
  Cc: linux-pwm, Alexandre Belloni, kernel-janitors, linux-kernel,
	Ludovic Desroches, Uwe Kleine-König, Lee Jones,
	Claudiu Beznea, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 501 bytes --]

On Fri, Dec 10, 2021 at 12:22:50AM +0000, Colin Ian King wrote:
> 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 <colin.i.king@gmail.com>
> ---
>  drivers/pwm/pwm-atmel.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Thierry

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-02-24 12:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10  0:22 [PATCH] pwm: atmel: remove redundant initialization of variable timeout Colin Ian King
2021-12-10  0:22 ` Colin Ian King
2021-12-10  7:45 ` Uwe Kleine-König
2021-12-10  7:45   ` Uwe Kleine-König
2021-12-10  9:02   ` Colin King (gmail)
2021-12-10  9:02     ` Colin King (gmail)
2022-02-24 12:54 ` Thierry Reding
2022-02-24 12:54   ` Thierry Reding

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.