tools: Fix shadowed declaration in err.h
authorJiri Olsa <jolsa@redhat.com>
Tue, 29 Sep 2015 14:53:12 +0000 (16:53 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 30 Sep 2015 21:34:22 +0000 (18:34 -0300)
The error variable breaks build on CentOS 6.7, due to collision with
global error symbol:

    CC       util/evlist.o
  cc1: warnings being treated as errors
  In file included from util/evlist.c:28:
  tools/include/linux/err.h: In function ‘ERR_PTR’:
  tools/include/linux/err.h:34: error: declaration of ‘error’ shadows a global declaration
  util/util.h:135: error: shadowed declaration is here

Using 'error_' name instead to fix it.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/n/tip-i9mdgdbrgauy3fe76s9rd125@git.kernel.org
Reported-by: Vinson Lee <vlee@twopensource.com>
[ Use 'error_' instead of 'err' to, visually, not diverge too much from include/linux/err.h ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/include/linux/err.h

index c9ada48f5156d99a617cbc11e4a410b7baaf38da..bdc3dd8131d4eb95cbff12bc9c80e59cd7312704 100644 (file)
@@ -31,9 +31,9 @@
 
 #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
 
-static inline void * __must_check ERR_PTR(long error)
+static inline void * __must_check ERR_PTR(long error_)
 {
-       return (void *) error;
+       return (void *) error_;
 }
 
 static inline long __must_check PTR_ERR(__force const void *ptr)