All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pipe: remove redundant assignment to pointer buf
@ 2022-01-19 22:56 Colin Ian King
  2022-01-20  8:51 ` Christian Brauner
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-01-19 22:56 UTC (permalink / raw)
  To: Alexander Viro, linux-fsdevel; +Cc: kernel-janitors, linux-kernel, llvm

The pointer buf is being assigned a value that is never read, it is
being re-assigned later on closer to where is it required to be set.
The assignment is redundant and can be removed. Cleans up clang
scan build warning:

fs/pipe.c:490:24: warning: Value stored to 'buf' during its
initialization is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 fs/pipe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/pipe.c b/fs/pipe.c
index cc28623a67b6..d19229df66ee 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -487,7 +487,7 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from)
 		head = pipe->head;
 		if (!pipe_full(head, pipe->tail, pipe->max_usage)) {
 			unsigned int mask = pipe->ring_size - 1;
-			struct pipe_buffer *buf = &pipe->bufs[head & mask];
+			struct pipe_buffer *buf;
 			struct page *page = pipe->tmp_page;
 			int copied;
 
-- 
2.33.1


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

* Re: [PATCH] pipe: remove redundant assignment to pointer buf
  2022-01-19 22:56 [PATCH] pipe: remove redundant assignment to pointer buf Colin Ian King
@ 2022-01-20  8:51 ` Christian Brauner
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2022-01-20  8:51 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Alexander Viro, linux-fsdevel, kernel-janitors, linux-kernel, llvm

On Wed, Jan 19, 2022 at 10:56:33PM +0000, Colin Ian King wrote:
> The pointer buf is being assigned a value that is never read, it is
> being re-assigned later on closer to where is it required to be set.
> The assignment is redundant and can be removed. Cleans up clang
> scan build warning:
> 
> fs/pipe.c:490:24: warning: Value stored to 'buf' during its
> initialization is never read [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---

Acked-by: Christian Brauner <brauner@kernel.org>

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

end of thread, other threads:[~2022-01-20  8:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19 22:56 [PATCH] pipe: remove redundant assignment to pointer buf Colin Ian King
2022-01-20  8:51 ` Christian Brauner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.