[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-0dbfpi70aa66s6mtd8z6p391@git.kernel.org>
Date: Wed, 3 Jul 2019 07:18:31 -0700
From: tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: eranian@...gle.com, namhyung@...nel.org, mingo@...nel.org,
adrian.hunter@...el.com, tglx@...utronix.de, jolsa@...nel.org,
linux-kernel@...r.kernel.org, hpa@...or.com, acme@...hat.com
Subject: [tip:perf/core] perf header: Use skip_spaces() in __write_cpudesc()
Commit-ID: fc6a172600cd54e9b4efeb684daa8464991b6c26
Gitweb: https://git.kernel.org/tip/fc6a172600cd54e9b4efeb684daa8464991b6c26
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Tue, 25 Jun 2019 21:33:14 -0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 25 Jun 2019 21:34:31 -0300
perf header: Use skip_spaces() in __write_cpudesc()
No change in behaviour.
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Link: https://lkml.kernel.org/n/tip-0dbfpi70aa66s6mtd8z6p391@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/header.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index fca9dbaf61ae..1eb15f7517b0 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -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++));
}
Powered by blists - more mailing lists