diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-04-26 20:49:21 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-04-26 20:49:21 +0200 |
commit | 96395cbbc7e94cbbe4f76cf64cf122fabc19123d (patch) | |
tree | c0cf51cd06c2b98bf45ef786f88c9b662c6645e8 /tools/perf | |
parent | perf units: Move parse_tag_value() to units.[ch] (diff) | |
download | linux-96395cbbc7e94cbbe4f76cf64cf122fabc19123d.tar.xz linux-96395cbbc7e94cbbe4f76cf64cf122fabc19123d.zip |
tools lib string: Adopt prefixcmp() from perf and subcmd
Both had copies originating from git.git, move those to
tools/lib/string.c, getting both tools/lib/subcmd/ and tools/perf/ to
use it.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-uidwtticro1qhttzd2rkrkg1@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/strbuf.c | 9 | ||||
-rw-r--r-- | tools/perf/util/util.h | 2 |
2 files changed, 0 insertions, 11 deletions
diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c index e91b5e86f027..aafe908b82b5 100644 --- a/tools/perf/util/strbuf.c +++ b/tools/perf/util/strbuf.c @@ -3,15 +3,6 @@ #include <linux/kernel.h> #include <errno.h> -int prefixcmp(const char *str, const char *prefix) -{ - for (; ; str++, prefix++) - if (!*prefix) - return 0; - else if (*str != *prefix) - return (unsigned char)*prefix - (unsigned char)*str; -} - /* * Used as the default ->buf value, so that people can always assume * buf is non NULL and ->buf is NUL terminated even for a freshly diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index d620719775a8..5dfb9bb6482d 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -30,8 +30,6 @@ void warning(const char *err, ...) __attribute__((format (printf, 1, 2))); void set_warning_routine(void (*routine)(const char *err, va_list params)); -int prefixcmp(const char *str, const char *prefix); - static inline void *zalloc(size_t size) { return calloc(1, size); |