From: Caleb Sander Mateos Date: Fri, 20 Jun 2025 15:09:59 +0000 (-0600) Subject: ublk: remove task variable from __ublk_ch_uring_cmd() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be4f1b619f5a7fa1f5641c780bfec1a156c279cb;p=thirdparty%2Fkernel%2Flinux.git ublk: remove task variable from __ublk_ch_uring_cmd() The variable is computed from a simple expression and used once, so just replace it with the expression. Signed-off-by: Caleb Sander Mateos Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20250620151008.3976463-6-csander@purestorage.com Signed-off-by: Jens Axboe --- diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index c2f83036aacf1..d8985d49a05bf 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -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 */