Tejun Heo <[email protected]> writes:

> 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]>
> Cc: Vivek Goyal <[email protected]>
> Cc: Arianna Avanzini <[email protected]>

Acked-by: Jeff Moyer <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to