Skip to content

Commit

Permalink
block: clean up dead code that is now redundant
Browse files Browse the repository at this point in the history
The boolean next_sorted is set to false and is never changed, hence
the code that checks if it is true is dead code and can now be
removed.  This dead code occurred from a previous commit that cleaned
up the elevator and removed the setting of next_sorted to true.

Detected by CoverityScan, CID#1475401 ("'Constant' variable guards
dead code")

Fixes: a1ce35f ("block: remove dead elevator code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Colin Ian King authored and axboe committed Nov 14, 2018
1 parent 30e0662 commit 98c98cb
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,18 +394,11 @@ void elv_merge_requests(struct request_queue *q, struct request *rq,
struct request *next)
{
struct elevator_queue *e = q->elevator;
bool next_sorted = false;

if (e->type->ops.requests_merged)
e->type->ops.requests_merged(q, rq, next);

elv_rqhash_reposition(q, rq);

if (next_sorted) {
elv_rqhash_del(q, next);
q->nr_sorted--;
}

q->last_merge = rq;
}

Expand Down

0 comments on commit 98c98cb

Please sign in to comment.