Skip to contentSkip to conversation

usb: typec: ucsi: remove redundant assignment to variable num

PATCH In review Colin King 3 participants 3 messages Feb 8, 2020 – Feb 13, 2020

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 usb: typec: ucsi: remove redundant assignment to variable num

From: Colin Ian King <[email protected]>

Variable num is being assigned with a value that is never read, it is assigned a new value later in a for-loop. The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/usb/typec/ucsi/ucsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/ucsi/ucsi.c +1 -1
index d5a6aac86327..b1b72cb7af10 100644
@@ -400,7 +400,7 @@ static int ucsi_register_altmodes(struct ucsi_connector *con, u8 recipient)
 	struct typec_altmode_desc desc;
 	struct ucsi_altmode alt[2];
 	u64 command;
-	int num = 1;
+	int num;
 	int ret;
 	int len;
 	int j;
Signature · 1 line
2.25.0
maintainer
#1 lore raw
Quoted 17 lines · Colin King

From: Colin Ian King <[email protected]>

Variable num is being assigned with a value that is never read, it is assigned a new value later in a for-loop. The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/usb/typec/ucsi/ucsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/typec/ucsi/ucsi.c +0 -0
index d5a6aac86327..b1b72cb7af10 100644

drivers/usb/typec/ucsi/ucsi.c static int ucsi_register_altmodes(struct ucsi_connector *con, u8 recipient) · line 406

Quoted 8 lines
drivers/usb/typec/ucsi/ucsi.c +1 -1
@@ -400,7 +400,7 @@ static int ucsi_register_altmodes(struct ucsi_connector *con, u8 recipient)
 	struct typec_altmode_desc desc;
 	struct ucsi_altmode alt[2];
 	u64 command;
-	int num = 1;
+	int num;
 	int ret;
 	int len;
 	int j;

Greg! I'll pick this, and to you with a few other patches that I have in my queue for the ucsi driver. I hope that's OK.

thanks,

Signature · 1 line
heikki
#2 lore raw
Quoted 13 lines · Heikki Krogerus
Quoted 12 lines · Colin King

From: Colin Ian King <[email protected]>

Variable num is being assigned with a value that is never read, it is assigned a new value later in a for-loop. The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/usb/typec/ucsi/ucsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines

drivers/usb/typec/ucsi/ucsi.c static int ucsi_register_altmodes(struct ucsi_connector *con, u8 recipient) · line 406

Quoted 13 lines
drivers/usb/typec/ucsi/ucsi.c +1 -1
index d5a6aac86327..b1b72cb7af10 100644
@@ -400,7 +400,7 @@ static int ucsi_register_altmodes(struct ucsi_connector *con, u8 recipient)
 	struct typec_altmode_desc desc;
 	struct ucsi_altmode alt[2];
 	u64 command;
-	int num = 1;
+	int num;
 	int ret;
 	int len;
 	int j;

Greg! I'll pick this, and to you with a few other patches that I have in my queue for the ucsi driver. I hope that's OK.

Thats fine.