Skip to content

Commit 825aea6

Browse files
committed
io_uring/rw: cast rw->flags assignment to rwf_t
kernel test robot reports that a recent change of the sqe->rw_flags field throws a sparse warning on 32-bit archs: >> io_uring/rw.c:291:19: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __kernel_rwf_t [usertype] flags @@ got unsigned int @@ io_uring/rw.c:291:19: sparse: expected restricted __kernel_rwf_t [usertype] flags io_uring/rw.c:291:19: sparse: got unsigned int Force cast it to rwf_t to silence that new sparse warning. Fixes: cf73d99 ("io_uring: don't use int for ABI") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Jens Axboe <[email protected]>
1 parent 1bc8890 commit 825aea6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

io_uring/rw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ static int __io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe,
288288

289289
rw->addr = READ_ONCE(sqe->addr);
290290
rw->len = READ_ONCE(sqe->len);
291-
rw->flags = READ_ONCE(sqe->rw_flags);
291+
rw->flags = (__force rwf_t) READ_ONCE(sqe->rw_flags);
292292

293293
attr_type_mask = READ_ONCE(sqe->attr_type_mask);
294294
if (attr_type_mask) {

0 commit comments

Comments
 (0)