Skip to contentSkip to conversation

io_uring: remove redundant assignment to ret in io_register_iowq_max_workers()

PATCH Applied Nghia Le 2 participants 2 messages Nov 2, 2021

Subsystems (2)
lore
Share & tools
lore

Nghia Le

author
#0 lore raw

PATCH 1/1 io_uring: remove redundant assignment to ret in io_register_iowq_max_workers()

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.

---
 fs/io_uring.c | 1 -
 1 file changed, 1 deletion(-)
fs/io_uring.c +0 -1
index acc05ff3aa19..d18f1f46ca83 100644
@@ -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)
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 6 lines · Nghia Le

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.

Applied, thanks!

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

      commit: 83956c86fffe0465408c7d62e925d88748075e00

Best regards,

Signature · 1 line
Jens Axboe