Skip to content

Commit fefcb0d

Browse files
isilenceaxboe
authored andcommitted
io_uring/net: make io_net_vec_assign() return void
io_net_vec_assign() can only return 0 and it doesn't make sense for it to fail, so make it return void. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de> Link: https://lore.kernel.org/r/7c1a2390c99e17d3ae4e8562063e572d3cdeb164.1738087204.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent d19af0e commit fefcb0d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

io_uring/net.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static struct io_async_msghdr *io_msg_alloc_async(struct io_kiocb *req)
168168
}
169169

170170
/* assign new iovec to kmsg, if we need to */
171-
static int io_net_vec_assign(struct io_kiocb *req, struct io_async_msghdr *kmsg,
171+
static void io_net_vec_assign(struct io_kiocb *req, struct io_async_msghdr *kmsg,
172172
struct iovec *iov)
173173
{
174174
if (iov) {
@@ -178,7 +178,6 @@ static int io_net_vec_assign(struct io_kiocb *req, struct io_async_msghdr *kmsg,
178178
kfree(kmsg->free_iov);
179179
kmsg->free_iov = iov;
180180
}
181-
return 0;
182181
}
183182

184183
static inline void io_mshot_prep_retry(struct io_kiocb *req,
@@ -240,7 +239,8 @@ static int io_compat_msg_copy_hdr(struct io_kiocb *req,
240239
if (unlikely(ret < 0))
241240
return ret;
242241

243-
return io_net_vec_assign(req, iomsg, iov);
242+
io_net_vec_assign(req, iomsg, iov);
243+
return 0;
244244
}
245245
#endif
246246

@@ -299,7 +299,8 @@ static int io_msg_copy_hdr(struct io_kiocb *req, struct io_async_msghdr *iomsg,
299299
if (unlikely(ret < 0))
300300
return ret;
301301

302-
return io_net_vec_assign(req, iomsg, iov);
302+
io_net_vec_assign(req, iomsg, iov);
303+
return 0;
303304
}
304305

305306
static int io_sendmsg_copy_hdr(struct io_kiocb *req,

0 commit comments

Comments
 (0)