Skip to contentSkip to conversation

dyndbg: parse flags last, restore original behavior

PATCH In review Jim Cromie 1 participant 1 message Oct 29, 2019

Subsystems (2)
lore
Share & tools
lore

Jim Cromie

author maintainer
#0 lore raw

PATCH 5/16 dyndbg: parse flags last, restore original behavior

In commit 85f7f6c0edb84, I moved flags parsing before the query parsing. For error reporting, its more natural to parse in normal reading order. So restore previous behavior.

---
 lib/dynamic_debug.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
lib/dynamic_debug.c +4 -5
index 6eec5bd559fe..540ca0861cf0 100644
@@ -445,15 +445,14 @@ static int ddebug_exec_query(char *query_string, const char *modname)
 		pr_err("tokenize failed\n");
 		return -EINVAL;
 	}
-	/* check flags 1st (last arg) so query is pairs of spec,val */
-	if (ddebug_parse_flags(words[nwords-1], &flags, &mask)) {
-		pr_err("flags parse failed\n");
-		return -EINVAL;
-	}
 	if (ddebug_parse_query(words, nwords-1, &query, modname)) {
 		pr_err("query parse failed\n");
 		return -EINVAL;
 	}
+	if (ddebug_parse_flags(words[nwords-1], &flags, &mask)) {
+		pr_err("flags parse failed\n");
+		return -EINVAL;
+	}
 	/* actually go and implement the change */
 	nfound = ddebug_change(&query, flags, mask);
 	vpr_info_dq(&query, nfound ? "applied" : "no-match");
Signature · 1 line
2.21.0