From: tip-bot for Arnaldo Carvalho de Melo <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: eranian@google.com, namhyung@kernel.org, mingo@kernel.org,
adrian.hunter@intel.com, tglx@linutronix.de, jolsa@kernel.org,
linux-kernel@vger.kernel.org, hpa@zytor.com, acme@redhat.com
Subject: [tip:perf/core] perf header: Use skip_spaces() in __write_cpudesc()
Date: Wed, 3 Jul 2019 07:18:31 -0700 [thread overview]
Message-ID: <tip-0dbfpi70aa66s6mtd8z6p391@git.kernel.org> (raw)
Commit-ID: fc6a172600cd54e9b4efeb684daa8464991b6c26
Gitweb: https://git.kernel.org/tip/fc6a172600cd54e9b4efeb684daa8464991b6c26
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Tue, 25 Jun 2019 21:33:14 -0300
Committer: Arnaldo Carvalho de Melo <acme@redhat.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@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-0dbfpi70aa66s6mtd8z6p391@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
| 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--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++));
}
reply other threads:[~2019-07-03 14:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-0dbfpi70aa66s6mtd8z6p391@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=eranian@google.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.