public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: return void from io_put_kbuf_comp()
@ 2024-03-29 15:50 Ming Lei
  2024-03-29 16:07 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Ming Lei @ 2024-03-29 15:50 UTC (permalink / raw)
  To: Jens Axboe, io-uring; +Cc: Ming Lei

The two callers don't handle the return value of io_put_kbuf_comp(), so
change its return type into void.

Signed-off-by: Ming Lei <[email protected]>
---
 io_uring/kbuf.h | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/io_uring/kbuf.h b/io_uring/kbuf.h
index 1c7b654ee726..86931fa655ad 100644
--- a/io_uring/kbuf.h
+++ b/io_uring/kbuf.h
@@ -119,18 +119,12 @@ static inline void __io_put_kbuf_list(struct io_kiocb *req,
 	}
 }
 
-static inline unsigned int io_put_kbuf_comp(struct io_kiocb *req)
+static inline void io_put_kbuf_comp(struct io_kiocb *req)
 {
-	unsigned int ret;
-
 	lockdep_assert_held(&req->ctx->completion_lock);
 
-	if (!(req->flags & (REQ_F_BUFFER_SELECTED|REQ_F_BUFFER_RING)))
-		return 0;
-
-	ret = IORING_CQE_F_BUFFER | (req->buf_index << IORING_CQE_BUFFER_SHIFT);
-	__io_put_kbuf_list(req, &req->ctx->io_buffers_comp);
-	return ret;
+	if (req->flags & (REQ_F_BUFFER_SELECTED|REQ_F_BUFFER_RING))
+		__io_put_kbuf_list(req, &req->ctx->io_buffers_comp);
 }
 
 static inline unsigned int io_put_kbuf(struct io_kiocb *req,
-- 
2.41.0


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

end of thread, other threads:[~2024-03-30  0:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-29 15:50 [PATCH] io_uring: return void from io_put_kbuf_comp() Ming Lei
2024-03-29 16:07 ` Jens Axboe
2024-03-30  0:43   ` Ming Lei

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