lkml.org 
[lkml]   [2022]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 2/5] elevator: replace continue with else-if in elv_iosched_show
Date
else-if is more readable than continue here.

Signed-off-by: Jinlong Chen <nickyc975@zju.edu.cn>
---
block/elevator.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/block/elevator.c b/block/elevator.c
index 308bee253564..ffa750976d25 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -776,11 +776,9 @@ 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 (e == cur) {
+ if (e == cur)
len += sprintf(name+len, "[%s] ", cur->elevator_name);
- continue;
- }
- if (elv_support_features(q, e))
+ else if (elv_support_features(q, e))
len += sprintf(name+len, "%s ", e->elevator_name);
}
spin_unlock(&elv_list_lock);
--
2.34.1
\
 
 \ /
  Last update: 2022-11-29 16:49    [W:0.042 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site