summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2019-06-25 20:39:18 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-06-25 20:39:18 -0400
commit9bb5a27ac7958ce11cb02463b5a5f7f160d60916 (patch)
tree395e07796f04a033ed2f7c62376865cc2f633857
parentfc6a172600cd54e9b4efeb684daa8464991b6c26 (diff)
perf time-utils: Use skip_spaces()
No change in behaviour intended. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/n/tip-cpugv7qd5vzhbtvnlydo90jv@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/time-utils.c6
1 files 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 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2#include <stdlib.h> 2#include <stdlib.h>
3#include <string.h> 3#include <string.h>
4#include <linux/string.h>
4#include <sys/time.h> 5#include <sys/time.h>
5#include <linux/time64.h> 6#include <linux/time64.h>
6#include <time.h> 7#include <time.h>
@@ -141,10 +142,7 @@ static int perf_time__parse_strs(struct perf_time_interval *ptime,
141 for (i = 0, p = str; i < num - 1; i++) { 142 for (i = 0, p = str; i < num - 1; i++) {
142 arg = p; 143 arg = p;
143 /* Find next comma, there must be one */ 144 /* Find next comma, there must be one */
144 p = strchr(p, ',') + 1; 145 p = skip_spaces(strchr(p, ',') + 1);
145 /* Skip white space */
146 while (isspace(*p))
147 p++;
148 /* Skip the value, must not contain space or comma */ 146 /* Skip the value, must not contain space or comma */
149 while (*p && !isspace(*p)) { 147 while (*p && !isspace(*p)) {
150 if (*p++ == ',') { 148 if (*p++ == ',') {