diff options
| author | Tejun Heo <tj@kernel.org> | 2015-08-18 14:54:57 -0700 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2016-09-01 12:07:01 +0200 |
| commit | b6c68af22557db5863566ed155616851fccd3da8 (patch) | |
| tree | f642f4d0e0a50b978dad822057ae68f66e552a3f /include/linux/task_work.h | |
| parent | d931e32a80355f61fe1d5d634199a8da2a365c4e (diff) | |
cfq-iosched: simplify control flow in cfq_get_queue()
cfq_get_queue()'s control flow looks like the following.
async_cfqq = NULL;
cfqq = NULL;
if (!is_sync) {
...
async_cfqq = ...;
cfqq = *async_cfqq;
}
if (!cfqq)
cfqq = ...;
if (!is_sync && !(*async_cfqq))
...;
The only thing the local variable init, the second if, and the
async_cfqq test in the third if achieves is to skip cfqq creation and
installation if *async_cfqq was already non-NULL. This is needlessly
complicated with different tests examining the same condition.
Simplify it to the following.
if (!is_sync) {
...
async_cfqq = ...;
cfqq = *async_cfqq;
if (cfqq)
goto out;
}
cfqq = ...;
if (!is_sync)
...;
out:
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Jeff Moyer <jmoyer@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Arianna Avanzini <avanzini.arianna@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Diffstat (limited to 'include/linux/task_work.h')
0 files changed, 0 insertions, 0 deletions
