diff options
| author | Sasha Levin <sashal@kernel.org> | 2026-11-04 09:46:23 -0500 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-11-04 08:06:12 -0700 |
| commit | 699e7ba5915c8b2c76e257e157464f2bfe7ab8bb (patch) | |
| tree | 09f1999e9775933858beaa006a5d0afca7d4706e | |
| parent | edeac4546a71b6c1db4ba006a2dbf7c863f54e9a (diff) | |
selftests/io_uring: cast optval through uintptr_t in mini_liburing.h
io_uring_prep_cmd() puts the optval pointer into the 64-bit optval field
of the SQE with a plain cast, which warns on 32-bit architectures:
mini_liburing.h:272:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
Cast through uintptr_t, and include <stdint.h> for it.
Reviewed-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Link: https://patch.msgid.link/20261104144623.3803717-1-sashal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
| -rw-r--r-- | tools/include/io_uring/mini_liburing.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/include/io_uring/mini_liburing.h b/tools/include/io_uring/mini_liburing.h index 44be4446feda..6afe7efb4497 100644 --- a/tools/include/io_uring/mini_liburing.h +++ b/tools/include/io_uring/mini_liburing.h @@ -3,6 +3,7 @@ #include <linux/io_uring.h> #include <sys/mman.h> #include <sys/syscall.h> +#include <stdint.h> #include <stdio.h> #include <string.h> #include <unistd.h> @@ -269,7 +270,7 @@ static inline void io_uring_prep_cmd(struct io_uring_sqe *sqe, int op, sqe->level = level; sqe->optname = optname; - sqe->optval = (unsigned long long)optval; + sqe->optval = (unsigned long long)(uintptr_t)optval; sqe->optlen = optlen; } |
