summaryrefslogtreecommitdiffstats
path: root/block/blk-mq.c
diff options
context:
space:
mode:
authorAndré Almeida <andrealmeid@collabora.com>2019-10-25 22:16:51 +0200
committerJens Axboe <axboe@kernel.dk>2019-10-25 22:28:10 +0200
commit1fead7182f381ab0ebab5eaf1a060a15550da994 (patch)
tree412538fe967fcfccd7e14826a568cd433c7bc287 /block/blk-mq.c
parentblock: reorder bio::__bi_remaining for better packing (diff)
downloadlinux-1fead7182f381ab0ebab5eaf1a060a15550da994.tar.xz
linux-1fead7182f381ab0ebab5eaf1a060a15550da994.zip
blk-mq: remove needless goto from blk_mq_get_driver_tag
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>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r--block/blk-mq.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index df41b2d16261..c0f3357a2050 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -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;
@@ -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;
}