summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-02-27 13:43:53 -0700
committerJens Axboe <axboe@kernel.dk>2020-02-27 13:43:53 -0700
commit2275c905c0e17765b2942ff2fd2ecfde64a04115 (patch)
treed0e896f38316c96692e060616288db83088ce079
parent7061b5fb1778b9bf30b865e23d867c256a4bbd35 (diff)
downloadliburing-2275c905c0e17765b2942ff2fd2ecfde64a04115.tar.gz
liburing-2275c905c0e17765b2942ff2fd2ecfde64a04115.tar.bz2
Fix 32-bit warning for io_uring_prep_splice()
../src/include/liburing.h: In function 'io_uring_prep_splice': ../src/include/liburing.h:200:50: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 200 | io_uring_prep_rw(IORING_OP_SPLICE, sqe, fd_out, (void *)off_in, Do the usual 32-bit cast trick. Fixes: 4f4eff4ca75f ("splice: add splice(2) helpers") Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/include/liburing.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 5a17b76..c0d00a9 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -197,7 +197,8 @@ static inline void io_uring_prep_splice(struct io_uring_sqe *sqe,
unsigned int nbytes,
unsigned int splice_flags)
{
- io_uring_prep_rw(IORING_OP_SPLICE, sqe, fd_out, (void *)off_in,
+ io_uring_prep_rw(IORING_OP_SPLICE, sqe, fd_out,
+ (void *) (uintptr_t) off_in,
nbytes, off_out);
sqe->splice_fd_in = fd_in;
sqe->splice_flags = splice_flags;