summaryrefslogtreecommitdiff
path: root/tools/perf/util/string2.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2019-06-26 11:42:03 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-06-26 11:42:03 -0300
commit328584804edc950fb4608c9a38e396ac71ef22b6 (patch)
treeea398fb09a36ea3af7f213ccbb2179b1889985d5 /tools/perf/util/string2.h
parent526bbbdd442ce143b52cd6a8b4ee424f9930be0d (diff)
downloadlinux-next-328584804edc950fb4608c9a38e396ac71ef22b6.tar.gz
perf tools: Ditch rtrim(), use skip_spaces() to get closer to the kernel
No change in behaviour, just using the same kernel idiom for such operation. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: André Goddard Rosa <andre.goddard@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/n/tip-a85lkptkt0ru40irpga8yf54@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/string2.h')
-rw-r--r--tools/perf/util/string2.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/string2.h b/tools/perf/util/string2.h
index 07fd37568543..db02059e31c5 100644
--- a/tools/perf/util/string2.h
+++ b/tools/perf/util/string2.h
@@ -2,6 +2,7 @@
#ifndef PERF_STRING_H
#define PERF_STRING_H
+#include <linux/string.h>
#include <linux/types.h>
#include <stddef.h>
#include <string.h>
@@ -22,12 +23,11 @@ static inline bool strisglob(const char *str)
int strtailcmp(const char *s1, const char *s2);
char *strxfrchar(char *s, char from, char to);
-char *ltrim(char *s);
char *rtrim(char *s);
static inline char *trim(char *s)
{
- return ltrim(rtrim(s));
+ return skip_spaces(rtrim(s));
}
char *asprintf_expr_inout_ints(const char *var, bool in, size_t nints, int *ints);