From 7ea50d52849fe8ffa5b5b74c979b60b1045d6fc9 Mon Sep 17 00:00:00 2001 From: Jeroen Hofstee Date: Sat, 10 Aug 2013 17:16:50 +0200 Subject: compiler_gcc: do not redefine __gnu_attributes gcc allows extensions to be non compiler specific by defining __* macros for the attributes supported by gcc. Having a different definition causes many warnings during the build (cdefs.h on FreeBSD uses __attribute((__pure__)) where u-boot uses __attribute__((pure)) for example). Do not redefine these macros to suppress these warnings. This patch ignores the checkpatch warning: WARNING: __packed is preferred over __attribute__((packed)) Signed-off-by: Jeroen Hofstee --- include/linux/compiler-gcc.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'include/linux/compiler-gcc.h') diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 73dcf804bc..9896e547b9 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -50,7 +50,9 @@ #endif #define __deprecated __attribute__((deprecated)) -#define __packed __attribute__((packed)) +#ifndef __packed +# define __packed __attribute__((packed)) +#endif #define __weak __attribute__((weak)) /* @@ -73,8 +75,12 @@ * would be. * [...] */ -#define __pure __attribute__((pure)) -#define __aligned(x) __attribute__((aligned(x))) +#ifndef __pure +# define __pure __attribute__((pure)) +#endif +#ifndef __aligned +# define __aligned(x) __attribute__((aligned(x))) +#endif #define __printf(a,b) __attribute__((format(printf,a,b))) #define noinline __attribute__((noinline)) #define __attribute_const__ __attribute__((__const__)) -- cgit