Skip to contentSkip to conversation

io_uring: fix casts to io_req_flags_t

PATCH Applied Min-Hua Chen 2 participants 2 messages Sep 22, 2024 – Sep 24, 2024 io_uring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring: fix casts to io_req_flags_t

Apply __force cast to restricted io_req_flags_t type to fix the following sparse warning:

io_uring/io_uring.c:2026:23: sparse: warning: cast to restricted io_req_flags_t

No functional changes intended.

---
 io_uring/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/io_uring.c +1 -1
index f3570e81ecb4..de79fa259d56 100644
@@ -2023,7 +2023,7 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
 	req->opcode = opcode = READ_ONCE(sqe->opcode);
 	/* same numerical values with corresponding REQ_F_*, safe to copy */
 	sqe_flags = READ_ONCE(sqe->flags);
-	req->flags = (io_req_flags_t) sqe_flags;
+	req->flags = (__force io_req_flags_t) sqe_flags;
 	req->cqe.user_data = READ_ONCE(sqe->user_data);
 	req->file = NULL;
 	req->rsrc_node = NULL;
Signature · 1 line
2.43.0
maintainer Applied
#1 lore raw
Quoted 8 lines · Min-Hua Chen

Apply __force cast to restricted io_req_flags_t type to fix the following sparse warning:

io_uring/io_uring.c:2026:23: sparse: warning: cast to restricted io_req_flags_t

No functional changes intended.

[...]

Applied, thanks!

[1/1] io_uring: fix casts to io_req_flags_t

      commit: 5dc4669c80354d3d7fdf87ac853bd1246928f2b7

Best regards,

Signature · 1 line
Jens Axboe