* [PATCH] relay: remove redundant assignment to pointer buf
@ 2022-05-08 21:21 Colin Ian King
2022-05-08 23:39 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-05-08 21:21 UTC (permalink / raw)
To: Christoph Hellwig, Andrew Morton
Cc: kernel-janitors, Jens Axboe, Kalle Valo, linux-kernel
Pointer buf is being assigned a value that is not being read, buf
is being re-assigned in the next starement. The assignment is
redundant and can be removed.
Cleans up clang scan build warning:
kernel/relay.c:443:8: warning: Although the value stored to 'buf' is
used in the enclosing expression, the value is never actually read
from 'buf' [deadcode.DeadStores]
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
kernel/relay.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/relay.c b/kernel/relay.c
index d1a67fbb819d..6a611e779e95 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -440,7 +440,7 @@ int relay_prepare_cpu(unsigned int cpu)
mutex_lock(&relay_channels_mutex);
list_for_each_entry(chan, &relay_channels, list) {
- if ((buf = *per_cpu_ptr(chan->buf, cpu)))
+ if (*per_cpu_ptr(chan->buf, cpu))
continue;
buf = relay_open_buf(chan, cpu);
if (!buf) {
--
2.35.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] relay: remove redundant assignment to pointer buf
2022-05-08 21:21 [PATCH] relay: remove redundant assignment to pointer buf Colin Ian King
@ 2022-05-08 23:39 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2022-05-08 23:39 UTC (permalink / raw)
To: Colin Ian King, Christoph Hellwig, Andrew Morton
Cc: kernel-janitors, Kalle Valo, linux-kernel
On 5/8/22 3:21 PM, Colin Ian King wrote:
> Pointer buf is being assigned a value that is not being read, buf
> is being re-assigned in the next starement. The assignment is
> redundant and can be removed.
>
> Cleans up clang scan build warning:
> kernel/relay.c:443:8: warning: Although the value stored to 'buf' is
> used in the enclosing expression, the value is never actually read
> from 'buf' [deadcode.DeadStores]
Andrew, I'm assuming you'll pick this up?
Reviewed-by: Jens Axboe <axboe@kernel.dk>
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-08 23:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-08 21:21 [PATCH] relay: remove redundant assignment to pointer buf Colin Ian King
2022-05-08 23:39 ` Jens Axboe
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®