Skip to contentSkip to conversation

remove redundant assignment to variable retval

PATCH In review Colin Ian King 2 participants 2 messages Apr 18, 2023 – Apr 24, 2023

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

PATCH 1/1 remove redundant assignment to variable retval

Variable retval is being assigned a value that is never read, it is being re-assigned a new value in both paths of a following if statement. Remove the assignment.

Cleans up clang-scan warning:
kernel/trace/rv/rv.c:293:2: warning: Value stored to 'retval' is never read [deadcode.DeadStores]

        retval = count;
---
 kernel/trace/rv/rv.c | 2 --
 1 file changed, 2 deletions(-)
kernel/trace/rv/rv.c +0 -2
index 7e9061828c24..2f68e93fff0b 100644
@@ -290,8 +290,6 @@ static ssize_t monitor_enable_write_data(struct file *filp, const char __user *u
 	if (retval)
 		return retval;
 
-	retval = count;
-
 	mutex_lock(&rv_interface_lock);
 
 	if (val)
Signature · 1 line
2.30.2
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Colin Ian King

Variable retval is being assigned a value that is never read, it is being re-assigned a new value in both paths of a following if statement. Remove the assignment.

Cleans up clang-scan warning:
kernel/trace/rv/rv.c:293:2: warning: Value stored to 'retval' is never read [deadcode.DeadStores]

        retval = count;

Thanks!
-- Daniel