diff options
author | Nathan Chancellor <natechancellor@gmail.com> | 2018-09-21 02:27:23 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-10-17 00:25:23 +0200 |
commit | 0bfe7d3cae58f02a05c39fba6829d6e7b50802f5 (patch) | |
tree | 21a462ffa0fea5f826aedad3f29ab784fc22874c /block/blk-rq-qos.c | |
parent | scsi: bfa: Remove unused functions (diff) | |
download | linux-0bfe7d3cae58f02a05c39fba6829d6e7b50802f5.tar.xz linux-0bfe7d3cae58f02a05c39fba6829d6e7b50802f5.zip |
scsi: qla2xxx: Simplify conditional check
Clang generates a warning when it sees a logical not followed by a
conditional operator like ==, >, or < because it thinks that the logical
not should be applied to the whole statement:
drivers/scsi/qla2xxx/qla_nx.c:3702:7: warning: logical not is only
applied to the left hand side of this comparison
[-Wlogical-not-parentheses]
if (!qla2x00_eh_wait_for_pending_commands(vha, 0, 0,
^
drivers/scsi/qla2xxx/qla_nx.c:3702:7: note: add parentheses after the
'!' to evaluate the comparison first
if (!qla2x00_eh_wait_for_pending_commands(vha, 0, 0,
^
(
drivers/scsi/qla2xxx/qla_nx.c:3702:7: note: add parentheses around left
hand side expression to silence this warning
if (!qla2x00_eh_wait_for_pending_commands(vha, 0, 0,
^
(
1 warning generated.
It assumes the author might have made a mistake in their logic:
if (!a == b) -> if (!(a == b))
Sometimes that is the case; other times, it's just a super convoluted
way of saying 'if (a)' when b = 0:
if (!1 == 0) -> if (0 == 0) -> if (true)
Alternatively:
if (!1 == 0) -> if (!!1) -> if (1)
Simplify this comparison so that Clang doesn't complain.
Link: https://github.com/ClangBuiltLinux/linux/issues/80
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'block/blk-rq-qos.c')
0 files changed, 0 insertions, 0 deletions