[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bdc86387d74ea059d04f301df414ee3d6564634d.1701993656.git.jim.cromie@gmail.com>
Date: Thu, 7 Dec 2023 17:15:10 -0700
From: Jim Cromie <jim.cromie@...il.com>
To: lb@...ihalf.com, linux-kernel@...r.kernel.org
Cc: akpm@...ux-foundation.org, bleung@...gle.com, contact@...rsion.fr,
daniel@...ll.ch, dianders@...omium.org, groeck@...gle.com,
jbaron@...mai.com, jim.cromie@...il.com, john.ogness@...utronix.de,
keescook@...omium.org, pmladek@...e.com, ppaalanen@...il.com,
rostedt@...dmis.org, seanpaul@...omium.org,
sergey.senozhatsky@...il.com, upstream@...ihalf.com,
vincent.whitchurch@...s.com, yanivt@...gle.com,
gregkh@...uxfoundation.org
Subject: [re: PATCH v2 00/15 - 07/11] dyndbg: __skip_spaces
This private version treats a comma like a space.
Its not known necessary ATM, but seems prudent.
Signed-off-by: Jim Cromie <jim.cromie@...il.com>
---
lib/dynamic_debug.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index a380b8151dd8..c974f6e19ca1 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -628,6 +628,14 @@ static int ddebug_change(const struct ddebug_query *query,
return nfound;
}
+char *__skip_spaces(const char *str)
+{
+ str = skip_spaces(str);
+ if (*str == ',')
+ str = skip_spaces(++str);
+ return (char *)str;
+}
+
/*
* Split the buffer `buf' into space-separated words.
* Handles simple " and ' quoting, i.e. without nested,
@@ -642,7 +650,7 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords)
char *end;
/* Skip leading whitespace */
- buf = skip_spaces(buf);
+ buf = __skip_spaces(buf);
if (!*buf)
break; /* oh, it was trailing whitespace */
if (*buf == '#')
@@ -959,7 +967,7 @@ static int ddebug_exec_queries(char *query, const char *modname)
if (split)
*split++ = '\0';
- query = skip_spaces(query);
+ query = __skip_spaces(query);
if (!query || !*query || *query == '#')
continue;
--
2.43.0
Powered by blists - more mailing lists