Skip to content

Commit bbbef3e

Browse files
Ming Leiaxboe
authored andcommitted
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 Jens's suggestion to rename it as io_put_kbuf_drop(). Signed-off-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20240407132759.4056167-1-ming.lei@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent c29006a commit bbbef3e

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

io_uring/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ static void io_clean_op(struct io_kiocb *req)
381381
{
382382
if (req->flags & REQ_F_BUFFER_SELECTED) {
383383
spin_lock(&req->ctx->completion_lock);
384-
io_put_kbuf_comp(req);
384+
io_kbuf_drop(req);
385385
spin_unlock(&req->ctx->completion_lock);
386386
}
387387

io_uring/kbuf.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,14 @@ static inline void __io_put_kbuf_list(struct io_kiocb *req,
120120
}
121121
}
122122

123-
static inline unsigned int io_put_kbuf_comp(struct io_kiocb *req)
123+
static inline void io_kbuf_drop(struct io_kiocb *req)
124124
{
125-
unsigned int ret;
126-
127125
lockdep_assert_held(&req->ctx->completion_lock);
128126

129127
if (!(req->flags & (REQ_F_BUFFER_SELECTED|REQ_F_BUFFER_RING)))
130-
return 0;
128+
return;
131129

132-
ret = IORING_CQE_F_BUFFER | (req->buf_index << IORING_CQE_BUFFER_SHIFT);
133130
__io_put_kbuf_list(req, &req->ctx->io_buffers_comp);
134-
return ret;
135131
}
136132

137133
static inline unsigned int io_put_kbuf(struct io_kiocb *req,

0 commit comments

Comments
 (0)