public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: make io_sqpoll_wait_sq return void
@ 2023-01-15  7:15 Quanfa Fu
  2023-01-15 15:38 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Quanfa Fu @ 2023-01-15  7:15 UTC (permalink / raw)
  To: axboe, asml.silence; +Cc: io-uring, linux-kernel, Quanfa Fu

Change the return type to void since it always return 0, and no need
to do the checking in syscall io_uring_enter.

Signed-off-by: Quanfa Fu <[email protected]>
---
 io_uring/io_uring.c | 8 +++-----
 io_uring/sqpoll.c   | 3 +--
 io_uring/sqpoll.h   | 2 +-
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 2ac1cd8d23ea..7305c9e34566 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -3330,11 +3330,9 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
 		}
 		if (flags & IORING_ENTER_SQ_WAKEUP)
 			wake_up(&ctx->sq_data->wait);
-		if (flags & IORING_ENTER_SQ_WAIT) {
-			ret = io_sqpoll_wait_sq(ctx);
-			if (ret)
-				goto out;
-		}
+		if (flags & IORING_ENTER_SQ_WAIT)
+			io_sqpoll_wait_sq(ctx);
+
 		ret = to_submit;
 	} else if (to_submit) {
 		ret = io_uring_add_tctx_node(ctx);
diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c
index 559652380672..0119d3f1a556 100644
--- a/io_uring/sqpoll.c
+++ b/io_uring/sqpoll.c
@@ -312,7 +312,7 @@ static int io_sq_thread(void *data)
 	do_exit(0);
 }
 
-int io_sqpoll_wait_sq(struct io_ring_ctx *ctx)
+void io_sqpoll_wait_sq(struct io_ring_ctx *ctx)
 {
 	DEFINE_WAIT(wait);
 
@@ -327,7 +327,6 @@ int io_sqpoll_wait_sq(struct io_ring_ctx *ctx)
 	} while (!signal_pending(current));
 
 	finish_wait(&ctx->sqo_sq_wait, &wait);
-	return 0;
 }
 
 __cold int io_sq_offload_create(struct io_ring_ctx *ctx,
diff --git a/io_uring/sqpoll.h b/io_uring/sqpoll.h
index 0c3fbcd1f583..e1b8d508d22d 100644
--- a/io_uring/sqpoll.h
+++ b/io_uring/sqpoll.h
@@ -26,4 +26,4 @@ void io_sq_thread_stop(struct io_sq_data *sqd);
 void io_sq_thread_park(struct io_sq_data *sqd);
 void io_sq_thread_unpark(struct io_sq_data *sqd);
 void io_put_sq_data(struct io_sq_data *sqd);
-int io_sqpoll_wait_sq(struct io_ring_ctx *ctx);
+void io_sqpoll_wait_sq(struct io_ring_ctx *ctx);
-- 
2.31.1


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

* Re: [PATCH] io_uring: make io_sqpoll_wait_sq return void
  2023-01-15  7:15 [PATCH] io_uring: make io_sqpoll_wait_sq return void Quanfa Fu
@ 2023-01-15 15:38 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2023-01-15 15:38 UTC (permalink / raw)
  To: asml.silence, Quanfa Fu; +Cc: io-uring, linux-kernel


On Sun, 15 Jan 2023 15:15:19 +0800, Quanfa Fu wrote:
> Change the return type to void since it always return 0, and no need
> to do the checking in syscall io_uring_enter.
> 
> 

Applied, thanks!

[1/1] io_uring: make io_sqpoll_wait_sq return void
      commit: 19d49cb3be0d03cd19f02fd5a0760a53bcc2ae25

Best regards,
-- 
Jens Axboe




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

end of thread, other threads:[~2023-01-15 15:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-15  7:15 [PATCH] io_uring: make io_sqpoll_wait_sq return void Quanfa Fu
2023-01-15 15:38 ` Jens Axboe

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