]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
perf header: Use skip_spaces() in __write_cpudesc()
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 26 Jun 2019 00:33:14 +0000 (21:33 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 26 Jun 2019 00:34:31 +0000 (21:34 -0300)
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>
tools/perf/util/header.c

index fca9dbaf61ae5edd874bef5d330a4888f1831a8a..1eb15f7517b061cf05b256fbdb6ccabf169cea5f 100644 (file)
@@ -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++));
                }