Skip to content

Commit

Permalink
blk-mq: remove needless goto from blk_mq_get_driver_tag
Browse files Browse the repository at this point in the history
The only usage of the label "done" is when (rq->tag != -1) at the
beginning of the function. Rather than jumping to label, we can just
remove this label and execute the code at the "if". Besides that, the
code that would be executed after the label "done" is the return of the
logical expression (rq->tag != -1) but since we are already inside the
if, we now that this is true. Remove the label and replace the goto with
the proper result of the label.

Signed-off-by: André Almeida <andrealmeid@collabora.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
André Almeida authored and Jens Axboe committed Oct 25, 2019
1 parent 993e4cd commit 1fead71
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ bool blk_mq_get_driver_tag(struct request *rq)
bool shared;

if (rq->tag != -1)
goto done;
return true;

if (blk_mq_tag_is_reserved(data.hctx->sched_tags, rq->internal_tag))
data.flags |= BLK_MQ_REQ_RESERVED;
Expand All @@ -1051,7 +1051,6 @@ bool blk_mq_get_driver_tag(struct request *rq)
data.hctx->tags->rqs[rq->tag] = rq;
}

done:
return rq->tag != -1;
}

Expand Down

0 comments on commit 1fead71

Please sign in to comment.