[linux-safety] [PATCH] io_uring: remove redundant assignment to ret in io_register_iowq_max_workers()

"Nghia Le" <[email protected]> Fri, 29 Oct 2021 22:59:36 +0700
Newsgroups tech.elisa.lists.linux-safety
Message-ID <20211029155936.AIAuzzJrRDz95-HshlGW95_OKS185XM7pNZfw2dpQew@z>
After the assignment, no paths but only exit path 'err' using ret as
return value. However,before going to exit path 'err', ret is changed
as the return value of io_wq_max_workers(). Hence, the assignment is
redundant and can be removed.

Signed-off-by: Nghia Le <[email protected]>
---
 fs/io_uring.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index acc05ff3aa19..d18f1f46ca83 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -10800,7 +10800,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.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#258): https://lists.elisa.tech/g/linux-safety/message/258
Mute This Topic: https://lists.elisa.tech/mt/86680054/5278000
Group Owner: [email protected]
Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-