]> www.infradead.org Git - users/hch/block.git/commitdiff
constify io_uring_cmd
authorChristoph Hellwig <hch@lst.de>
Fri, 6 May 2022 05:58:29 +0000 (07:58 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 6 May 2022 05:58:42 +0000 (07:58 +0200)
and remove the nasty cast

fs/io_uring.c
include/linux/io_uring.h

index 884f40f5153673d88a423f3a690a31709abde4d8..646cc1497e12529137b06c934ff0f9668f5f9377 100644 (file)
@@ -4963,7 +4963,7 @@ static int io_uring_cmd_prep(struct io_kiocb *req,
 
        if (sqe->ioprio || sqe->rw_flags)
                return -EINVAL;
-       ioucmd->cmd = (void *) sqe->cmd;
+       ioucmd->cmd = sqe->cmd;
        ioucmd->cmd_op = READ_ONCE(sqe->cmd_op);
        return 0;
 }
index b892b038de217e1327ada53d0e39652a483ac767..4a2f6cc5a4927fdc0280b2b5b86d47938b8bd768 100644 (file)
@@ -19,7 +19,7 @@ enum io_uring_cmd_flags {
 
 struct io_uring_cmd {
        struct file     *file;
-       void            *cmd;
+       const void      *cmd;
        /* callback to defer completions to task context */
        void (*task_work_cb)(struct io_uring_cmd *cmd);
        u32             cmd_op;