Skip to contentSkip to conversation

thunderbolt: remove redundant assignment to variable len

PATCH Applied Colin Ian King 2 participants 2 messages Oct 19, 2022 – Oct 23, 2022

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

PATCH 1/1 thunderbolt: remove redundant assignment to variable len

The variable len is assigned a value that is never read. It is re-assigned a new value in the following do-while loop and never referenced after the loop. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
drivers/thunderbolt/xdomain.c:344:2: warning: Value stored to 'len' is never read [deadcode.DeadStores]

---
 drivers/thunderbolt/xdomain.c | 1 -
 1 file changed, 1 deletion(-)
drivers/thunderbolt/xdomain.c +0 -1
index f00b2f62d8e3..5e99f93ee1a1 100644
@@ -341,7 +341,6 @@ static int tb_xdp_properties_request(struct tb_ctl *ctl, u64 route,
 	memcpy(&req.src_uuid, src_uuid, sizeof(*src_uuid));
 	memcpy(&req.dst_uuid, dst_uuid, sizeof(*dst_uuid));
 
-	len = 0;
 	data_len = 0;
 
 	do {
Signature · 1 line
2.37.3
#1 lore raw
Quoted 9 lines · Colin Ian King

The variable len is assigned a value that is never read. It is re-assigned a new value in the following do-while loop and never referenced after the loop. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
drivers/thunderbolt/xdomain.c:344:2: warning: Value stored to 'len' is never read [deadcode.DeadStores]

Applied to thunderbolt.git/next, thanks!