[PATCH 26/43] perf time-utils: Use skip_spaces()

From: Arnaldo Carvalho de Melo
Date: Mon Jul 01 2019 - 22:27:48 EST


From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

No change in behaviour intended.

Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Jin Yao <yao.jin@xxxxxxxxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Link: https://lkml.kernel.org/n/tip-cpugv7qd5vzhbtvnlydo90jv@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/time-utils.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/time-utils.c b/tools/perf/util/time-utils.c
index 369fa19dd596..c2abc259b51d 100644
--- a/tools/perf/util/time-utils.c
+++ b/tools/perf/util/time-utils.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include <stdlib.h>
#include <string.h>
+#include <linux/string.h>
#include <sys/time.h>
#include <linux/time64.h>
#include <time.h>
@@ -141,10 +142,7 @@ static int perf_time__parse_strs(struct perf_time_interval *ptime,
for (i = 0, p = str; i < num - 1; i++) {
arg = p;
/* Find next comma, there must be one */
- p = strchr(p, ',') + 1;
- /* Skip white space */
- while (isspace(*p))
- p++;
+ p = skip_spaces(strchr(p, ',') + 1);
/* Skip the value, must not contain space or comma */
while (*p && !isspace(*p)) {
if (*p++ == ',') {
--
2.20.1