Skip to contentSkip to conversation

tty: synclink_gt: remove redundant initialization of variable count

PATCH In review Colin King 2 participants 2 messages Apr 20, 2021

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 tty: synclink_gt: remove redundant initialization of variable count

From: Colin Ian King <[email protected]>

The variable count is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/tty/synclink_gt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/synclink_gt.c +1 -1
index 994618618466..5523cf7bd1c2 100644
@@ -4958,7 +4958,7 @@ static int loopback_test(struct slgt_info *info)
 #define TESTFRAMESIZE 20
 
 	unsigned long timeout;
-	u16 count = TESTFRAMESIZE;
+	u16 count;
 	unsigned char buf[TESTFRAMESIZE];
 	int rc = -ENODEV;
 	unsigned long flags;
Signature · 1 line
2.30.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Colin King

From: Colin Ian King <[email protected]>

The variable count is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

Quoted 18 lines
---
  drivers/tty/synclink_gt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/synclink_gt.c +1 -1
index 994618618466..5523cf7bd1c2 100644
@@ -4958,7 +4958,7 @@ static int loopback_test(struct slgt_info *info)
  #define TESTFRAMESIZE 20
 
  	unsigned long timeout;
-	u16 count = TESTFRAMESIZE;
+	u16 count;
  	unsigned char buf[TESTFRAMESIZE];
  	int rc = -ENODEV;
  	unsigned long flags;
Signature · 1 line
js