[PATCH 15/15] perf tool: Build fix, remove duplicate declarations

From: Arnaldo Carvalho de Melo
Date: Fri Jun 01 2012 - 18:17:38 EST


From: David Ahern <dsahern@xxxxxxxxx>

I'm sure I have some gremlins running around today, but I am
consistently hitting this compile failure on Fedora 14 and 16:

In file included from util/sort.h:12:0,
from builtin-diff.c:15:
util/string.h:7:5: error: redundant redeclaration of âhex2u64â [-Werror=redundant-decls]
util/symbol.h:32:5: note: previous declaration of âhex2u64â was here
util/string.h:8:7: error: redundant redeclaration of âstrxfrcharâ [-Werror=redundant-decls]
util/symbol.h:33:7: note: previous declaration of âstrxfrcharâ was here
util/string.h:9:5: error: redundant redeclaration of âperf_atollâ [-Werror=redundant-decls]
util/util.h:238:5: note: previous declaration of âperf_atollâ was here
util/string.h:10:8: error: redundant redeclaration of âargv_splitâ [-Werror=redundant-decls]
util/util.h:239:8: note: previous declaration of âargv_splitâ was here
util/string.h:11:6: error: redundant redeclaration of âargv_freeâ [-Werror=redundant-decls]
util/util.h:240:6: note: previous declaration of âargv_freeâ was here
util/string.h:12:6: error: redundant redeclaration of âstrglobmatchâ [-Werror=redundant-decls]
util/util.h:241:6: note: previous declaration of âstrglobmatchâ was here
util/string.h:13:6: error: redundant redeclaration of âstrlazymatchâ [-Werror=redundant-decls]
util/util.h:242:6: note: previous declaration of âstrlazymatchâ was here
cc1: all warnings being treated as errors
make: *** [/tmp/pbuild/builtin-diff.o] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory `/opt/sw/ahern/perf.git/tools/perf'

Fix it by removing duplicates.

Signed-off-by: David Ahern <dsahern@xxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Link: http://lkml.kernel.org/r/1338563000-93294-1-git-send-email-dsahern@xxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/symbol.h | 4 +---
tools/perf/util/util.h | 6 +-----
2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index af0752b..bf4b679 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -10,6 +10,7 @@
#include <linux/rbtree.h>
#include <stdio.h>
#include <byteswap.h>
+#include "string.h"

#ifdef HAVE_CPLUS_DEMANGLE
extern char *cplus_demangle(const char *, int);
@@ -30,9 +31,6 @@ static inline char *bfd_demangle(void __used *v, const char __used *c,
#endif
#endif

-int hex2u64(const char *ptr, u64 *val);
-char *strxfrchar(char *s, char from, char to);
-
/*
* libelf 0.8.x and earlier do not support ELF_C_READ_MMAP;
* for newer versions we can use mmap to reduce memory usage:
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 2daaedb..5152592 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -78,6 +78,7 @@
#include "../../../include/linux/magic.h"
#include "types.h"
#include <sys/ttydefaults.h>
+#include "string.h"

extern const char *graph_line;
extern const char *graph_dotted_line;
@@ -235,11 +236,6 @@ static inline int sane_case(int x, int high)
int mkdir_p(char *path, mode_t mode);
int copyfile(const char *from, const char *to);

-s64 perf_atoll(const char *str);
-char **argv_split(const char *str, int *argcp);
-void argv_free(char **argv);
-bool strglobmatch(const char *str, const char *pat);
-bool strlazymatch(const char *str, const char *pat);
int strtailcmp(const char *s1, const char *s2);
unsigned long convert_unit(unsigned long value, char *unit);
int readn(int fd, void *buf, size_t size);
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/