Skip to contentSkip to conversation

Block: blk-flush: removed an unnecessary else statement

PATCH New Khan M Rashedun-Naby 1 participant 1 message Dec 20, 2017 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Block: blk-flush: removed an unnecessary else statement

As both of the if and else statement block is returning something then there is no need of the else statement. Thus this else statement has been removed.

---
 block/blk-flush.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
block/blk-flush.c +7 -6
index f171706..b629014 100644
@@ -137,13 +137,14 @@ static bool blk_flush_queue_rq(struct request *rq, bool add_front)
 	if (rq->q->mq_ops) {
 		blk_mq_add_to_requeue_list(rq, add_front, true);
 		return false;
-	} else {
-		if (add_front)
-			list_add(&rq->queuelist, &rq->q->queue_head);
-		else
-			list_add_tail(&rq->queuelist, &rq->q->queue_head);
-		return true;
 	}
+
+	if (add_front)
+		list_add(&rq->queuelist, &rq->q->queue_head);
+	else
+		list_add_tail(&rq->queuelist, &rq->q->queue_head);
+
+	return true;
 }
 
 /**
Signature · 1 line
2.7.4