diff mbox series

[next] rv: remove redundant assignment to variable retval

Message ID 20230418150018.3123753-1-colin.i.king@gmail.com (mailing list archive)
State Accepted
Headers show
Series [next] rv: remove redundant assignment to variable retval | expand

Commit Message

Colin Ian King April 18, 2023, 3 p.m. UTC
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;

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 kernel/trace/rv/rv.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Daniel Bristot de Oliveira April 24, 2023, 9:20 a.m. UTC | #1
On 4/18/23 17:00, Colin Ian King wrote:
> 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;
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Acked-by: Daniel Bristot de Oliveira <bristot@kernel.org>

Thanks!
-- Daniel
diff mbox series

Patch

diff --git a/kernel/trace/rv/rv.c b/kernel/trace/rv/rv.c
index 7e9061828c24..2f68e93fff0b 100644
--- a/kernel/trace/rv/rv.c
+++ b/kernel/trace/rv/rv.c
@@ -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)