Skip to contentSkip to conversation

io_uring: remove redundant initialization of variable ret

PATCH Applied Colin King 3 participants 3 messages Feb 10, 2021

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 io_uring: remove redundant initialization of variable ret

From: Colin Ian King <[email protected]>

The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

Fixes b63534c41e20 ("io_uring: re-issue block requests that failed because of resources")
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/io_uring.c +1 -1
index 909b3169d74e..eff58a967822 100644
@@ -2785,7 +2785,7 @@ static void io_complete_rw_common(struct kiocb *kiocb, long res,
 static bool io_resubmit_prep(struct io_kiocb *req)
 {
 	struct iovec inline_vecs[UIO_FASTIOV], *iovec = inline_vecs;
-	int rw, ret = -ECANCELED;
+	int rw, ret;
 	struct iov_iter iter;
 
 	/* already prepared */
Signature · 1 line
2.30.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Colin King

From: Colin Ian King <[email protected]>

The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

Fixes b63534c41e20 ("io_uring: re-issue block requests that failed because of resources")

Looks good.

maintainer Applied
#2 lore raw
In reply to Colin King
Quoted 5 lines · Colin King

From: Colin Ian King <[email protected]>

The variable ret is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Applied, thanks.

Signature · 1 line
Jens Axboe