perf time-utils: Use skip_spaces()
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: 9bb5a27ac7958ce11cb02463b5a5f7f160d60916 Gitweb: https://git.kernel.org/tip/9bb5a27ac7958ce11cb02463b5a5f7f160d60916 Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Tue, 25 Jun 2019 21:39:18 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 25 Jun 2019 21:39:18 -0300
perf time-utils: Use skip_spaces()
No change in behaviour intended.
Cc Adrian Hunter <[email protected]>
Cc David Ahern <[email protected]>
Cc Jin Yao <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/util/time-utils.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
tools/perf/util/time-utils.c +2 -4
@@ -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++ ==',' ) {