archive mirror
 help / color / mirror / Atom feed
From: Colin King <>
To: Jens Axboe <>,
Subject: [PATCH][next] block: clean up dead code that is now redundant
Date: Wed, 14 Nov 2018 22:17:05 +0000	[thread overview]
Message-ID: <> (raw)

From: Colin Ian King <>

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: a1ce35fa4985 ("block: remove dead elevator code")
Signed-off-by: Colin Ian King <>
 block/elevator.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/block/elevator.c b/block/elevator.c
index 19351ffa56b1..796436270682 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -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;

             reply	other threads:[~2018-11-14 22:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14 22:17 Colin King [this message]
2018-11-14 22:20 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: [PATCH][next] block: clean up dead code that is now redundant' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox