linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/pipe.c: clean code by removing unnecessary initialization
@ 2020-09-12 10:34 mateusznosek0
  0 siblings, 0 replies; only message in thread
From: mateusznosek0 @ 2020-09-12 10:34 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel; +Cc: Mateusz Nosek, viro

From: Mateusz Nosek <mateusznosek0@gmail.com>

Previously variable 'buf' was initialized, but was not read later before
reassigning.  So the initialization can be removed.

Signed-off-by: Mateusz Nosek <mateusznosek0@gmail.com>
---
 fs/pipe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/pipe.c b/fs/pipe.c
index 60dbee457143..a18ee5f6383b 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -495,7 +495,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.20.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-12 10:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-12 10:34 [PATCH] fs/pipe.c: clean code by removing unnecessary initialization mateusznosek0

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).