From: Namhyung Kim Date: Tue, 24 May 2011 08:23:21 +0000 (+0200) Subject: cfq-iosched: algebraic simplification in cfq_prio_to_maxrq() X-Git-Tag: firefly_0821_release~7613^2~1153^2~3 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=b9f8ce059940064a732da49b5d6e618381dad956;p=firefly-linux-kernel-4.4.55.git cfq-iosched: algebraic simplification in cfq_prio_to_maxrq() Simplify the calculation in cfq_prio_to_maxrq(), plus replace CFQ_PRIO_LISTS to IOPRIO_BE_NR since they are the same and IOPRIO_BE_NR looks more reasonable in this context IMHO. Signed-off-by: Namhyung Kim Signed-off-by: Jens Axboe --- diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 0316f6eece03..00763e510228 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -2102,7 +2102,7 @@ cfq_prio_to_maxrq(struct cfq_data *cfqd, struct cfq_queue *cfqq) WARN_ON(cfqq->ioprio >= IOPRIO_BE_NR); - return 2 * (base_rq + base_rq * (CFQ_PRIO_LISTS - 1 - cfqq->ioprio)); + return 2 * base_rq * (IOPRIO_BE_NR - cfqq->ioprio); } /*