diff mbox series

HID: asus: Remove variable count

Message ID 20221024161102.2171702-1-colin.i.king@gmail.com (mailing list archive)
State Mainlined
Commit 7f9dbf54c3dc7170df86f7753abb41b5d7e8779e
Delegated to: Jiri Kosina
Headers show
Series HID: asus: Remove variable count | expand

Commit Message

Colin Ian King Oct. 24, 2022, 4:11 p.m. UTC
Variable count is just being incremented and it's never used
anywhere else. The variable and the increment are redundant so
remove it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/hid/hid-asus.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Jiri Kosina Nov. 2, 2022, 1:11 p.m. UTC | #1
On Mon, 24 Oct 2022, Colin Ian King wrote:

> Variable count is just being incremented and it's never used
> anywhere else. The variable and the increment are redundant so
> remove it.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  drivers/hid/hid-asus.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> index b59c3dafa6a4..f99752b998f3 100644
> --- a/drivers/hid/hid-asus.c
> +++ b/drivers/hid/hid-asus.c
> @@ -219,14 +219,13 @@ static void asus_report_tool_width(struct asus_drvdata *drvdat)
>  {
>  	struct input_mt *mt = drvdat->input->mt;
>  	struct input_mt_slot *oldest;
> -	int oldid, count, i;
> +	int oldid, i;
>  
>  	if (drvdat->tp->contact_size < 5)
>  		return;
>  
>  	oldest = NULL;
>  	oldid = mt->trkid;
> -	count = 0;
>  
>  	for (i = 0; i < mt->num_slots; ++i) {
>  		struct input_mt_slot *ps = &mt->slots[i];
> @@ -238,7 +237,6 @@ static void asus_report_tool_width(struct asus_drvdata *drvdat)
>  			oldest = ps;
>  			oldid = id;
>  		}
> -		count++;
>  	}

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index b59c3dafa6a4..f99752b998f3 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -219,14 +219,13 @@  static void asus_report_tool_width(struct asus_drvdata *drvdat)
 {
 	struct input_mt *mt = drvdat->input->mt;
 	struct input_mt_slot *oldest;
-	int oldid, count, i;
+	int oldid, i;
 
 	if (drvdat->tp->contact_size < 5)
 		return;
 
 	oldest = NULL;
 	oldid = mt->trkid;
-	count = 0;
 
 	for (i = 0; i < mt->num_slots; ++i) {
 		struct input_mt_slot *ps = &mt->slots[i];
@@ -238,7 +237,6 @@  static void asus_report_tool_width(struct asus_drvdata *drvdat)
 			oldest = ps;
 			oldid = id;
 		}
-		count++;
 	}
 
 	if (oldest) {