public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: remove redundant assignment to ret in io_register_iowq_max_workers()
@ 2021-11-02 19:05 Nghia Le
  2021-11-02 20:29 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Nghia Le @ 2021-11-02 19:05 UTC (permalink / raw)
  To: axboe, asml.silence; +Cc: Nghia Le, io-uring, linux-kernel, lukas.bulwahn

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 <[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


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

* Re: [PATCH] io_uring: remove redundant assignment to ret in io_register_iowq_max_workers()
  2021-11-02 19:05 [PATCH] io_uring: remove redundant assignment to ret in io_register_iowq_max_workers() Nghia Le
@ 2021-11-02 20:29 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-11-02 20:29 UTC (permalink / raw)
  To: Nghia Le, asml.silence; +Cc: lukas.bulwahn, linux-kernel, io-uring

On Wed, 3 Nov 2021 02:05:21 +0700, Nghia Le wrote:
> 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,
-- 
Jens Axboe



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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-02 19:05 [PATCH] io_uring: remove redundant assignment to ret in io_register_iowq_max_workers() Nghia Le
2021-11-02 20:29 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox