提交 265600b7 编写于 作者: B Baolin Wang 提交者: Jens Axboe

block: Remove a duplicative condition

Remove a duplicative condition to remove below cppcheck warnings:

"warning: Redundant condition: sched_allow_merge. '!A || (A && B)' is
equivalent to '!A || B' [redundantCondition]"
Reported-by: Nkernel test robot <lkp@intel.com>
Signed-off-by: NBaolin Wang <baolin.wang@linux.alibaba.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 8327cce5
...@@ -996,13 +996,11 @@ static enum bio_merge_status blk_attempt_bio_merge(struct request_queue *q, ...@@ -996,13 +996,11 @@ static enum bio_merge_status blk_attempt_bio_merge(struct request_queue *q,
switch (blk_try_merge(rq, bio)) { switch (blk_try_merge(rq, bio)) {
case ELEVATOR_BACK_MERGE: case ELEVATOR_BACK_MERGE:
if (!sched_allow_merge || if (!sched_allow_merge || blk_mq_sched_allow_merge(q, rq, bio))
(sched_allow_merge && blk_mq_sched_allow_merge(q, rq, bio)))
return bio_attempt_back_merge(rq, bio, nr_segs); return bio_attempt_back_merge(rq, bio, nr_segs);
break; break;
case ELEVATOR_FRONT_MERGE: case ELEVATOR_FRONT_MERGE:
if (!sched_allow_merge || if (!sched_allow_merge || blk_mq_sched_allow_merge(q, rq, bio))
(sched_allow_merge && blk_mq_sched_allow_merge(q, rq, bio)))
return bio_attempt_front_merge(rq, bio, nr_segs); return bio_attempt_front_merge(rq, bio, nr_segs);
break; break;
case ELEVATOR_DISCARD_MERGE: case ELEVATOR_DISCARD_MERGE:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册