io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] io_uring: remove redundant initialization of variable ret
@ 2021-02-10 20:00 Colin King
  2021-02-10 20:05 ` Chaitanya Kulkarni
  2021-02-10 20:30 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2021-02-10 20:00 UTC (permalink / raw)
  To: Jens Axboe, Pavel Begunkov, io-uring; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 909b3169d74e..eff58a967822 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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 */
-- 
2.30.0


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

* Re: [PATCH][next] io_uring: remove redundant initialization of variable ret
  2021-02-10 20:00 [PATCH][next] io_uring: remove redundant initialization of variable ret Colin King
@ 2021-02-10 20:05 ` Chaitanya Kulkarni
  2021-02-10 20:30 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-10 20:05 UTC (permalink / raw)
  To: Colin King, Jens Axboe, Pavel Begunkov, io-uring
  Cc: kernel-janitors, linux-kernel

On 2/10/21 12:02, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>


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

* Re: [PATCH][next] io_uring: remove redundant initialization of variable ret
  2021-02-10 20:00 [PATCH][next] io_uring: remove redundant initialization of variable ret Colin King
  2021-02-10 20:05 ` Chaitanya Kulkarni
@ 2021-02-10 20:30 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2021-02-10 20:30 UTC (permalink / raw)
  To: Colin King, Pavel Begunkov, io-uring; +Cc: kernel-janitors, linux-kernel

On 2/10/21 1:00 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> 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.

-- 
Jens Axboe


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

end of thread, other threads:[~2021-02-10 20:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-10 20:00 [PATCH][next] io_uring: remove redundant initialization of variable ret Colin King
2021-02-10 20:05 ` Chaitanya Kulkarni
2021-02-10 20:30 ` Jens Axboe

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).