Thread (8 messages) 8 messages, 2 authors, 2023-03-03
STALE1242d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 1/6] util.c: code cleanup for parse_layout_faulty()

From: Coly Li <hidden>
Date: 2023-03-03 08:33:37
Subsystem: the rest · Maintainer: Linus Torvalds

Resort the code lines in parse_layout_faulty() to make it more
comfortable, no logic change.

Signed-off-by: Coly Li <redacted>
---
 util.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/util.c b/util.c
index 7fc881bf..b0b7aec4 100644
--- a/util.c
+++ b/util.c
@@ -421,12 +421,15 @@ int parse_layout_10(char *layout)
 
 int parse_layout_faulty(char *layout)
 {
+	int ln, mode;
+	char *m;
+
 	if (!layout)
 		return -1;
+
 	/* Parse the layout string for 'faulty' */
-	int ln = strcspn(layout, "0123456789");
-	char *m = xstrdup(layout);
-	int mode;
+	ln = strcspn(layout, "0123456789");
+	m = xstrdup(layout);
 	m[ln] = 0;
 	mode = map_name(faultylayout, m);
 	if (mode == UnSet)
-- 
2.39.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help