Skip to contentSkip to conversation

io_uring: return void from io_put_kbuf_comp()

PATCH In review Ming Lei 2 participants 2 messages Apr 7, 2024 io_uring

lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH v2 1/1 io_uring: return void from io_put_kbuf_comp()

The only caller doesn't handle the return value of io_put_kbuf_comp(), so change its return type into void.

Also follow Jen's suggestion to rename it as io_put_kbuf_drop().

---
V2:
- rename & following check style in kbuf.c(Jens)

 io_uring/io_uring.c | 2 +-
 io_uring/kbuf.h     | 8 ++------
 2 files changed, 3 insertions(+), 7 deletions(-)
io_uring/io_uring.c +1 -1
index afbe0522e8d8..8df9ad010803 100644
@@ -381,7 +381,7 @@ static void io_clean_op(struct io_kiocb *req)
 {
 	if (req->flags & REQ_F_BUFFER_SELECTED) {
 		spin_lock(&req->ctx->completion_lock);
-		io_put_kbuf_comp(req);
+		io_kbuf_drop(req);
 		spin_unlock(&req->ctx->completion_lock);
 	}
 
io_uring/kbuf.h +2 -6
index 53c141d9a8b2..5a9635ee0217 100644
@@ -120,18 +120,14 @@ 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_kbuf_drop(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;
+		return;
 
-	ret = IORING_CQE_F_BUFFER | (req->buf_index << IORING_CQE_BUFFER_SHIFT);
 	__io_put_kbuf_list(req, &req->ctx->io_buffers_comp);
-	return ret;
 }
 
 static inline unsigned int io_put_kbuf(struct io_kiocb *req,
Signature · 1 line
2.41.0
maintainer
#1 lore raw
Quoted 4 lines · Ming Lei

The only caller doesn't handle the return value of io_put_kbuf_comp(), so change its return type into void.

Also follow Jen's suggestion to rename it as io_put_kbuf_drop().

Thanks Ming, applied.

Signature · 1 line
Jens Axboe