Skip to content

Commit

Permalink
scsi_lib: untangle 0 and BLK_MQ_RQ_QUEUE_OK
Browse files Browse the repository at this point in the history
Let's not depend on any of the BLK_MQ_RQ_QUEUE_* constants having
specific values. No functional change.

Signed-off-by: Omar Sandoval <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
osandov authored and axboe committed Nov 15, 2016
1 parent bac0000 commit 2868f13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1810,7 +1810,7 @@ static inline int prep_to_mq(int ret)
{
switch (ret) {
case BLKPREP_OK:
return 0;
return BLK_MQ_RQ_QUEUE_OK;
case BLKPREP_DEFER:
return BLK_MQ_RQ_QUEUE_BUSY;
default:
Expand Down Expand Up @@ -1897,7 +1897,7 @@ static int scsi_queue_rq(struct blk_mq_hw_ctx *hctx,
int reason;

ret = prep_to_mq(scsi_prep_state_check(sdev, req));
if (ret)
if (ret != BLK_MQ_RQ_QUEUE_OK)
goto out;

ret = BLK_MQ_RQ_QUEUE_BUSY;
Expand All @@ -1914,7 +1914,7 @@ static int scsi_queue_rq(struct blk_mq_hw_ctx *hctx,

if (!(req->rq_flags & RQF_DONTPREP)) {
ret = prep_to_mq(scsi_mq_prep_fn(req));
if (ret)
if (ret != BLK_MQ_RQ_QUEUE_OK)
goto out_dec_host_busy;
req->rq_flags |= RQF_DONTPREP;
} else {
Expand Down

0 comments on commit 2868f13

Please sign in to comment.