diff options
author | Tejun Heo <[email protected]> | 2015-08-18 14:54:57 -0700 |
---|---|---|
committer | Jens Axboe <[email protected]> | 2015-08-18 15:49:15 -0700 |
commit | 4ebc1c61d6185604c97fd0b0355ab668052044ab (patch) | |
tree | 366acca07997da745139dba40070eea624f768b9 /tools/perf/util/trace-event-scripting.c | |
parent | 5634cc2aa9aebc77bc862992e7805469dcf83dac (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 <[email protected]>
Acked-by: Jeff Moyer <[email protected]>
Cc: Vivek Goyal <[email protected]>
Cc: Arianna Avanzini <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions