]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ublk: remove task variable from __ublk_ch_uring_cmd()
authorCaleb Sander Mateos <csander@purestorage.com>
Fri, 20 Jun 2025 15:09:59 +0000 (09:09 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 30 Jun 2025 22:02:46 +0000 (16:02 -0600)
The variable is computed from a simple expression and used once, so just
replace it with the expression.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250620151008.3976463-6-csander@purestorage.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c

index c2f83036aacf1015c9feabf10027246ae9aa2900..d8985d49a05bf589ebf6da5e58ae70635e468e81 100644 (file)
@@ -2189,7 +2189,6 @@ static int __ublk_ch_uring_cmd(struct io_uring_cmd *cmd,
                               const struct ublksrv_io_cmd *ub_cmd)
 {
        struct ublk_device *ub = cmd->file->private_data;
-       struct task_struct *task;
        struct ublk_queue *ubq;
        struct ublk_io *io;
        u32 cmd_op = cmd->cmd_op;
@@ -2225,8 +2224,7 @@ static int __ublk_ch_uring_cmd(struct io_uring_cmd *cmd,
                return -EIOCBQUEUED;
        }
 
-       task = READ_ONCE(io->task);
-       if (task != current)
+       if (READ_ONCE(io->task) != current)
                goto out;
 
        /* there is pending io cmd, something must be wrong */