]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
io_uring/uring_cmd: specify io_uring_cmd_import_fixed() pointer type
authorCaleb Sander Mateos <csander@purestorage.com>
Fri, 28 Feb 2025 22:15:13 +0000 (15:15 -0700)
committerJens Axboe <axboe@kernel.dk>
Sat, 1 Mar 2025 02:14:43 +0000 (19:14 -0700)
io_uring_cmd_import_fixed() takes a struct io_uring_cmd *, but the type
of the ioucmd parameter is void *. Make the pointer type explicit so the
compiler can type check it.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Link: https://lore.kernel.org/r/20250228221514.604350-1-csander@purestorage.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/io_uring/cmd.h
io_uring/uring_cmd.c

index cf8d80d8473447940caea0d5212af9d9193bfd2d..5bc4f0d58506db7ab8790649a8a7cab59276dacc 100644 (file)
@@ -40,7 +40,8 @@ static inline void io_uring_cmd_private_sz_check(size_t cmd_sz)
 
 #if defined(CONFIG_IO_URING)
 int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw,
-                             struct iov_iter *iter, void *ioucmd,
+                             struct iov_iter *iter,
+                             struct io_uring_cmd *ioucmd,
                              unsigned int issue_flags);
 
 /*
@@ -68,9 +69,10 @@ void io_uring_cmd_mark_cancelable(struct io_uring_cmd *cmd,
 void io_uring_cmd_issue_blocking(struct io_uring_cmd *ioucmd);
 
 #else
-static inline int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw,
-                             struct iov_iter *iter, void *ioucmd,
-                             unsigned int issue_flags)
+static inline int
+io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw,
+                         struct iov_iter *iter, struct io_uring_cmd *ioucmd,
+                         unsigned int issue_flags)
 {
        return -EOPNOTSUPP;
 }
index 31d5e0948af148537f7254dff9dd6c7a0fe25767..de39b602aa829b5e7b81f987227cb2722d767e96 100644 (file)
@@ -245,7 +245,8 @@ int io_uring_cmd(struct io_kiocb *req, unsigned int issue_flags)
 }
 
 int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw,
-                             struct iov_iter *iter, void *ioucmd,
+                             struct iov_iter *iter,
+                             struct io_uring_cmd *ioucmd,
                              unsigned int issue_flags)
 {
        struct io_kiocb *req = cmd_to_io_kiocb(ioucmd);