perf header: Use skip_spaces() in __write_cpudesc()
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: fc6a172600cd54e9b4efeb684daa8464991b6c26 Gitweb: https://git.kernel.org/tip/fc6a172600cd54e9b4efeb684daa8464991b6c26 Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Tue, 25 Jun 2019 21:33:14 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 25 Jun 2019 21:34:31 -0300
perf header: Use skip_spaces() in __write_cpudesc()
No change in behaviour.
Cc Stephane Eranian <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/util/header.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
tools/perf/util/header.c +2 -3
@@ -13,6 +13,7 @@#include <linux/list.h> #include <linux/kernel.h> #include <linux/bitops.h> +#include <linux/string.h> #include <linux/stringify.h> #include <sys/stat.h> #include <sys/utsname.h>
@@ -416,10 +417,8 @@ static int __write_cpudesc(struct feat_fd *ff, const char *cpuinfo_proc)while (*p) {if (isspace (*p)) {char *r = p +1 ; -char *q = r; +char *q =skip_spaces (r); *p =' ' ; -while (*q &&isspace (*q)) - q++;if (q != (p+1 ))while ((*r++ = *q++)); }