From: Christoph Hellwig Date: Tue, 25 Oct 2022 19:02:37 +0000 (-0700) Subject: block: simplify the check for the current elevator in elv_iosched_show X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=413286602f13a32f76fc76909face048e15186e2;p=users%2Fhch%2Fblock.git block: simplify the check for the current elevator in elv_iosched_show Just compare the pointers instead of using the string based elevator_match. Signed-off-by: Christoph Hellwig --- diff --git a/block/elevator.c b/block/elevator.c index 4fc0d2f53929..77c16c5ef04f 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -786,7 +786,7 @@ ssize_t elv_iosched_show(struct request_queue *q, char *name) spin_lock(&elv_list_lock); list_for_each_entry(e, &elv_list, list) { - if (cur && elevator_match(cur, e->elevator_name, 0)) { + if (e == cur) { len += sprintf(name+len, "[%s] ", cur->elevator_name); continue; }