Skip to content

Commit

Permalink
block: drop needless assignment in set_task_ioprio()
Browse files Browse the repository at this point in the history
Commit 5fc11ee ("block: open code create_task_io_context in
set_task_ioprio") introduces a needless assignment
'ioc = task->io_context', as the local variable ioc is not further
used before returning.

Even after the further fix, commit a957b61 ("block: fix error in
handling dead task for ioprio setting"), the assignment still remains
needless.

Drop this needless assignment in set_task_ioprio().

This code smell was identified with 'make clang-analyzer'.

Fixes: 5fc11ee ("block: open code create_task_io_context in set_task_ioprio")
Signed-off-by: Lukas Bulwahn <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
bulwahn authored and axboe committed Dec 23, 2021
1 parent a16c724 commit 669a064
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions block/blk-ioc.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,10 @@ int set_task_ioprio(struct task_struct *task, int ioprio)
kmem_cache_free(iocontext_cachep, ioc);
goto out;
}
if (task->io_context) {
if (task->io_context)
kmem_cache_free(iocontext_cachep, ioc);
ioc = task->io_context;
} else {
else
task->io_context = ioc;
}
}
task->io_context->ioprio = ioprio;
out:
Expand Down

0 comments on commit 669a064

Please sign in to comment.