2023-05-04 07:30:07

by Lu Hongfei

[permalink] [raw]
Subject: [PATCH] Subject: io_uring: Remove the check of data->free_work and data->do_work in io_wq_create

Remove the check of data->free_work and data->do_work in io_wq_create
io_wq_create is only called in io_init_wq_offload, which has already
initialized free_work and do_work to io_wq_free_work and io_wq_submit_work
respectively, so there is no need to detect whether free_work and
do_work are null pointers in io_wq_create.

Signed-off-by: luhongfei <[email protected]>
---
io_uring/io-wq.c | 2 --
1 file changed, 2 deletions(-)
mode change 100644 => 100755 io_uring/io-wq.c

diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c
index f81c0a7136a5..b978a058ea51
--- a/io_uring/io-wq.c
+++ b/io_uring/io-wq.c
@@ -1143,8 +1143,6 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data)
int ret, node, i;
struct io_wq *wq;

- if (WARN_ON_ONCE(!data->free_work || !data->do_work))
- return ERR_PTR(-EINVAL);
if (WARN_ON_ONCE(!bounded))
return ERR_PTR(-EINVAL);

--
2.39.0