Skip to contentSkip to conversation

fs/pipe.c: clean code by removing unnecessary initialization

PATCH New [email protected] 1 participant 1 message Sep 12, 2020 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/pipe.c: clean code by removing unnecessary initialization

From: Mateusz Nosek <[email protected]>

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

---
 fs/pipe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/pipe.c +1 -1
index 60dbee457143..a18ee5f6383b 100644
@@ -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;
 
Signature · 1 line
2.20.1