Skip to contentSkip to conversation

HID: asus: Remove variable count

PATCH Applied Colin Ian King 2 participants 2 messages Oct 24, 2022 – Nov 2, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: asus: Remove variable count

Variable count is just being incremented and it's never used anywhere else. The variable and the increment are redundant so remove it.

---
 drivers/hid/hid-asus.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/hid/hid-asus.c +1 -3
index b59c3dafa6a4..f99752b998f3 100644
@@ -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) {
Signature · 1 line
2.37.3
maintainer Applied
#1 lore raw
Quoted 30 lines · Colin Ian King

Variable count is just being incremented and it's never used anywhere else. The variable and the increment are redundant so remove it.

---
 drivers/hid/hid-asus.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/hid/hid-asus.c +1 -2
index b59c3dafa6a4..f99752b998f3 100644
@@ -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];

drivers/hid/hid-asus.c static void asus_report_tool_width(struct asus_drvdata *drvdat) · line 240

Quoted 5 lines
drivers/hid/hid-asus.c +0 -1
@@ -238,7 +237,6 @@ static void asus_report_tool_width(struct asus_drvdata *drvdat)
 			oldest = ps;
 			oldid = id;
 		}
-		count++;
 	}

Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs