diff options
author | Dan Carpenter | 2018-12-07 22:06:12 -0700 |
---|---|---|
committer | Jens Axboe | 2018-12-07 22:27:01 -0700 |
commit | 29cadd2bb6670405086b177120593c1291273fb9 (patch) | |
tree | 210b8f749f7cb7e7f3e13a1483a43ec83386a392 /lib/sbitmap.c | |
parent | 3236b458c475524d0735f6dd0bd250478434c7b1 (diff) |
scsi: Fix a harmless double shift bug
Smatch generates a warning:
drivers/scsi/scsi_lib.c:1656 scsi_mq_done() warn: test_bit() takes a bit number
The problem is that SCMD_STATE_COMPLETE is supposed to be bit number 0
and not a mask like "(1 << 0)". It is used like this:
if (test_and_set_bit(SCMD_STATE_COMPLETE, &scmd->state))
The test_and_set_bit() has a shift built in so it's a double left shift
and uses bit number 1 instead of number 0. This bug is harmless because
it's done consistently and it doesn't clash with any other flags.
Fixes: f1342709d18a ("scsi: Do not rely on blk-mq for double completions")
Reviewed-by: Keith Busch <keith.busch@intel.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'lib/sbitmap.c')
0 files changed, 0 insertions, 0 deletions