block/blk-merge.c:999:26: warning: Redundant condition: sched_allow_merge. '!A || (A && B)' is equivalent to '!A || B'
PATCH 14/18 block/blk-merge.c:999:26: warning: Redundant condition: sched_allow_merge. '!A || (A && B)' is equivalent to '!A || B'
tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next head: 38f02fdbc7a5d5c4fc765e12541eab8b27b0eb91 commit: c7c06419eb01c4990598c960f337bd7c3d4fc377 [14/18] block: Add a new helper to attempt to merge a bio compiler: sh4-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
cppcheck warnings: (new ones prefixed by >>)
Quoted 1 line
Quoted 1 line
block/blk-merge.c:999:26: warning: Redundant condition:sched_allow_merge. '!A || (A && B)' is equivalent to '!A || B' [redundantCondition]
if (!sched_allow_merge ||
^
block/blk-merge.c:1004:26: warning: Redundant condition: sched_allow_merge. '!A || (A && B)' is equivalent to '!A || B' [redundantCondition]
if (!sched_allow_merge ||# https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?id=c7c06419eb01c4990598c960f337bd7c3d4fc377
git remote add block https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
git fetch --no-tags block for-next
git checkout c7c06419eb01c4990598c960f337bd7c3d4fc377
vim +999 block/blk-merge.c
c7c06419eb01c4 Baolin Wang 2020-08-28 988 static enum bio_merge_status blk_attempt_bio_merge(struct request_queue *q,
c7c06419eb01c4 Baolin Wang 2020-08-28 989 struct request *rq,
c7c06419eb01c4 Baolin Wang 2020-08-28 990 struct bio *bio,
c7c06419eb01c4 Baolin Wang 2020-08-28 991 unsigned int nr_segs,
c7c06419eb01c4 Baolin Wang 2020-08-28 992 bool sched_allow_merge)
c7c06419eb01c4 Baolin Wang 2020-08-28 993 {
c7c06419eb01c4 Baolin Wang 2020-08-28 994 if (!blk_rq_merge_ok(rq, bio))
c7c06419eb01c4 Baolin Wang 2020-08-28 995 return BIO_MERGE_NONE;
c7c06419eb01c4 Baolin Wang 2020-08-28 996
c7c06419eb01c4 Baolin Wang 2020-08-28 997 switch (blk_try_merge(rq, bio)) {
c7c06419eb01c4 Baolin Wang 2020-08-28 998 case ELEVATOR_BACK_MERGE:
c7c06419eb01c4 Baolin Wang 2020-08-28 @999 if (!sched_allow_merge ||
c7c06419eb01c4 Baolin Wang 2020-08-28 1000 (sched_allow_merge && blk_mq_sched_allow_merge(q, rq, bio)))
^^^^^^^^^^^^^^^^^Delete this duplicative condition?
c7c06419eb01c4 Baolin Wang 2020-08-28 1001 return bio_attempt_back_merge(rq, bio, nr_segs);
c7c06419eb01c4 Baolin Wang 2020-08-28 1002 break;
c7c06419eb01c4 Baolin Wang 2020-08-28 1003 case ELEVATOR_FRONT_MERGE:
c7c06419eb01c4 Baolin Wang 2020-08-28 1004 if (!sched_allow_merge ||
c7c06419eb01c4 Baolin Wang 2020-08-28 1005 (sched_allow_merge && blk_mq_sched_allow_merge(q, rq, bio)))
^^^^^^^^^^^^^^^^^Same
c7c06419eb01c4 Baolin Wang 2020-08-28 1006 return bio_attempt_front_merge(rq, bio, nr_segs); c7c06419eb01c4 Baolin Wang 2020-08-28 1007 break; c7c06419eb01c4 Baolin Wang 2020-08-28 1008 case ELEVATOR_DISCARD_MERGE: c7c06419eb01c4 Baolin Wang 2020-08-28 1009 return bio_attempt_discard_merge(q, rq, bio); c7c06419eb01c4 Baolin Wang 2020-08-28 1010 default: c7c06419eb01c4 Baolin Wang 2020-08-28 1011 return BIO_MERGE_NONE; c7c06419eb01c4 Baolin Wang 2020-08-28 1012 } c7c06419eb01c4 Baolin Wang 2020-08-28 1013 c7c06419eb01c4 Baolin Wang 2020-08-28 1014 return BIO_MERGE_FAILED; a7a10c146dc70e Baolin Wang 2020-08-28 1015 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org