Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1288532

[PATCH 4/4] elevator: use list_is_{first,last}

From Geliang Tang <geliangtang@163.com>
Newsgroups linux.kernel
Subject [PATCH 4/4] elevator: use list_is_{first,last}
Date 2015-12-10 15:30 +0100
Message-ID <qEaoi-7nL-15@gated-at.bofh.it> (permalink)
References <qEaeC-7jl-25@gated-at.bofh.it> <qEaeC-7jl-33@gated-at.bofh.it> <qEaeC-7jl-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


For better readability, use list_is_{first,last}() instead of open-coded.

Signed-off-by: Geliang Tang <geliangtang@163.com>
---
 block/noop-iosched.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/noop-iosched.c b/block/noop-iosched.c
index a163c48..d44326e 100644
--- a/block/noop-iosched.c
+++ b/block/noop-iosched.c
@@ -44,7 +44,7 @@ noop_former_request(struct request_queue *q, struct request *rq)
 {
 	struct noop_data *nd = q->elevator->elevator_data;
 
-	if (rq->queuelist.prev == &nd->queue)
+	if (list_is_first(&rq->queuelist, &nd->queue))
 		return NULL;
 	return list_prev_entry(rq, queuelist);
 }
@@ -54,7 +54,7 @@ noop_latter_request(struct request_queue *q, struct request *rq)
 {
 	struct noop_data *nd = q->elevator->elevator_data;
 
-	if (rq->queuelist.next == &nd->queue)
+	if (list_is_last(&rq->queuelist, &nd->queue))
 		return NULL;
 	return list_next_entry(rq, queuelist);
 }
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH 3/4] netfilter: ipset: use list_is_first() Geliang Tang <geliangtang@163.com> - 2015-12-10 15:20 +0100
  [PATCH 4/4] elevator: use list_is_{first,last} Geliang Tang <geliangtang@163.com> - 2015-12-10 15:30 +0100

csiph-web