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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 810826ac
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/string.h>
#include <linux/stringify.h> #include <linux/stringify.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/utsname.h> #include <sys/utsname.h>
...@@ -416,10 +417,8 @@ static int __write_cpudesc(struct feat_fd *ff, const char *cpuinfo_proc) ...@@ -416,10 +417,8 @@ static int __write_cpudesc(struct feat_fd *ff, const char *cpuinfo_proc)
while (*p) { while (*p) {
if (isspace(*p)) { if (isspace(*p)) {
char *r = p + 1; char *r = p + 1;
char *q = r; char *q = skip_spaces(r);
*p = ' '; *p = ' ';
while (*q && isspace(*q))
q++;
if (q != (p+1)) if (q != (p+1))
while ((*r++ = *q++)); while ((*r++ = *q++));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment