Input: tps6507x-ts: remove variable loops

Message ID 20221020181642.24417-1-colin.i.king@gmail.com
State New
Headers
Series Input: tps6507x-ts: remove variable loops |

Commit Message

Colin Ian King Oct. 20, 2022, 6:16 p.m. UTC
  The variable loops is being incremented but is never referenced,
it is redundant and can be removed.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/input/touchscreen/tps6507x-ts.c | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Mattijs Korpershoek Oct. 21, 2022, 1:04 p.m. UTC | #1
On Thu, Oct 20, 2022 at 19:16, Colin Ian King <colin.i.king@gmail.com> wrote:

> The variable loops is being incremented but is never referenced,
> it is redundant and can be removed.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

> ---
>  drivers/input/touchscreen/tps6507x-ts.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c
> index 357a3108f2e5..f48871767763 100644
> --- a/drivers/input/touchscreen/tps6507x-ts.c
> +++ b/drivers/input/touchscreen/tps6507x-ts.c
> @@ -119,7 +119,6 @@ static s32 tps6507x_adc_conversion(struct tps6507x_ts *tsc,
>  static s32 tps6507x_adc_standby(struct tps6507x_ts *tsc)
>  {
>  	s32 ret;
> -	s32 loops = 0;
>  	u8 val;
>  
>  	ret = tps6507x_write_u8(tsc,  TPS6507X_REG_ADCONFIG,
> @@ -141,7 +140,6 @@ static s32 tps6507x_adc_standby(struct tps6507x_ts *tsc)
>  		ret = tps6507x_read_u8(tsc, TPS6507X_REG_INT, &val);
>  		if (ret)
>  			return ret;
> -		loops++;
>  	}
>  
>  	return ret;
> -- 
> 2.37.3
  
Dmitry Torokhov Oct. 24, 2022, 11:59 a.m. UTC | #2
On Thu, Oct 20, 2022 at 07:16:42PM +0100, Colin Ian King wrote:
> The variable loops is being incremented but is never referenced,
> it is redundant and can be removed.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Applied, thank you.
  

Patch

diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c
index 357a3108f2e5..f48871767763 100644
--- a/drivers/input/touchscreen/tps6507x-ts.c
+++ b/drivers/input/touchscreen/tps6507x-ts.c
@@ -119,7 +119,6 @@  static s32 tps6507x_adc_conversion(struct tps6507x_ts *tsc,
 static s32 tps6507x_adc_standby(struct tps6507x_ts *tsc)
 {
 	s32 ret;
-	s32 loops = 0;
 	u8 val;
 
 	ret = tps6507x_write_u8(tsc,  TPS6507X_REG_ADCONFIG,
@@ -141,7 +140,6 @@  static s32 tps6507x_adc_standby(struct tps6507x_ts *tsc)
 		ret = tps6507x_read_u8(tsc, TPS6507X_REG_INT, &val);
 		if (ret)
 			return ret;
-		loops++;
 	}
 
 	return ret;