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

From: Nghia Le
Date: Tue Nov 02 2021 - 15:06:45 EST


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@xxxxxxxxx>
---
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