Skip to contentSkip to conversation

HID: sony: remove redundant assignment to variable ret

PATCH In review Colin Ian King 2 participants 2 messages Mar 28, 2024 – Apr 12, 2024

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

PATCH 1/1 HID: sony: remove redundant assignment to variable ret

The variable ret is being assigned a value that is never read afterwards. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
drivers/hid/hid-sony.c:2020:3: warning: Value stored to 'ret' is never read [deadcode.DeadStores]

---
 drivers/hid/hid-sony.c | 2 --
 1 file changed, 2 deletions(-)
drivers/hid/hid-sony.c +0 -2
index ebc0aa4e4345..1d37b39e1171 100644
@@ -2016,8 +2016,6 @@ static int sony_input_configured(struct hid_device *hdev,
 
 	} else if (sc->quirks & MOTION_CONTROLLER) {
 		sony_init_output_report(sc, motion_send_output_report);
-	} else {
-		ret = 0;
 	}
 
 	if (sc->quirks & SONY_LED_SUPPORT) {
Signature · 1 line
2.39.2
maintainer
#1 lore raw
Quoted 6 lines · Colin Ian King

The variable ret is being assigned a value that is never read afterwards. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
drivers/hid/hid-sony.c:2020:3: warning: Value stored to 'ret' is never read [deadcode.DeadStores]

That assignment is indeed bogus. Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs