Skip to contentSkip to conversation

Input: adi: remove redundant variable z

PATCH Applied Colin Ian King 2 participants 2 messages Mar 18, 2022 – Mar 21, 2022

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

PATCH 1/1 Input: adi: remove redundant variable z

Variable z is being assigned a value that is never read, the variable is redundant and can be removed.

Cleans up clang scan build warning:
drivers/input/joystick/adi.c:139:6: warning: Although the value stored to 'z' is used in the enclosing expression, the value is never actually read from 'z' [deadcode.DeadStores]

---
 drivers/input/joystick/adi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/input/joystick/adi.c +2 -2
index 592c95b87f54..e10d57bf1180 100644
@@ -123,7 +123,7 @@ static void adi_read_packet(struct adi_port *port)
 {
 	struct adi *adi = port->adi;
 	struct gameport *gameport = port->gameport;
-	unsigned char u, v, w, x, z;
+	unsigned char u, v, w, x;
 	int t[2], s[2], i;
 	unsigned long flags;
 
@@ -136,7 +136,7 @@ static void adi_read_packet(struct adi_port *port)
 	local_irq_save(flags);
 
 	gameport_trigger(gameport);
-	v = z = gameport_read(gameport);
+	v = gameport_read(gameport);
 
 	do {
 		u = v;
Signature · 1 line
2.35.1
maintainer Applied
#1 lore raw
Quoted 9 lines · Colin Ian King

Variable z is being assigned a value that is never read, the variable is redundant and can be removed.

Cleans up clang scan build warning:
drivers/input/joystick/adi.c:139:6: warning: Although the value stored to 'z' is used in the enclosing expression, the value is never actually read from 'z' [deadcode.DeadStores]

Applied, thank you.

Signature · 1 line
Dmitry