Blob Blame History Raw
From 83956c86fffe0465408c7d62e925d88748075e00 Mon Sep 17 00:00:00 2001
From: Nghia Le <nghialm78@gmail.com>
Date: Wed, 3 Nov 2021 02:05:21 +0700
Subject: [PATCH] io_uring: remove redundant assignment to ret in
 io_register_iowq_max_workers()
Git-commit: 83956c86fffe0465408c7d62e925d88748075e00
Patch-mainline: v5.16-rc1
References: bsc#1205205

After the assignment, only exit path with label 'err' uses ret as
return value. However,before exiting through this path with label 'err',
ret is assigned with the return value of io_wq_max_workers(). Hence, the
initial assignment is redundant and can be removed.

Signed-off-by: Nghia Le <nghialm78@gmail.com>
Link: https://lore.kernel.org/r/20211102190521.28291-1-nghialm78@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
---
 fs/io_uring.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 61c962c29235..1c8602f12c91 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -10794,7 +10794,6 @@ static __cold int io_register_iowq_max_workers(struct io_ring_ctx *ctx,
 	memcpy(ctx->iowq_limits, new_count, sizeof(new_count));
 	ctx->iowq_limits_set = true;
 
-	ret = -EINVAL;
 	if (tctx && tctx->io_wq) {
 		ret = io_wq_max_workers(tctx->io_wq, new_count);
 		if (ret)
-- 
2.35.3