mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][next] rv: remove redundant assignment to variable retval
@ 2023-04-18 15:00 Colin Ian King
  2023-04-24  9:20 ` Daniel Bristot de Oliveira
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2023-04-18 15:00 UTC (permalink / raw)
  To: Daniel Bristot de Oliveira, Steven Rostedt, Masami Hiramatsu,
	linux-trace-devel
  Cc: kernel-janitors, linux-kernel

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(-)

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)
-- 
2.30.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] rv: remove redundant assignment to variable retval
  2023-04-18 15:00 [PATCH][next] rv: remove redundant assignment to variable retval Colin Ian King
@ 2023-04-24  9:20 ` Daniel Bristot de Oliveira
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Bristot de Oliveira @ 2023-04-24  9:20 UTC (permalink / raw)
  To: Colin Ian King
  Cc: kernel-janitors, linux-kernel, Steven Rostedt, linux-trace-devel,
	Masami Hiramatsu

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-24  9:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-18 15:00 [PATCH][next] rv: remove redundant assignment to variable retval Colin Ian King
2023-04-24  9:20 ` Daniel Bristot de Oliveira

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®