diff options
author | Jeroen Hofstee <jeroen@myspectrum.nl> | 2013-08-10 17:16:50 +0200 |
---|---|---|
committer | jino.cho <jino.cho@samsung.com> | 2017-01-19 17:32:30 +0900 |
commit | 3814ec860a7f8dbd581ea432a717293d388350be (patch) | |
tree | fee1734baf6982cc8562a3a3959873dd0a8eedac | |
parent | e10b06ecb0703c9dd69fa627c8d49c7eb6379bdb (diff) | |
download | u-boot-artik-3814ec860a7f8dbd581ea432a717293d388350be.tar.gz u-boot-artik-3814ec860a7f8dbd581ea432a717293d388350be.tar.bz2 u-boot-artik-3814ec860a7f8dbd581ea432a717293d388350be.zip |
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 <jeroen@myspectrum.nl>
[backport from u-boot mainline for gcc6]
Signed-off-by: jino.cho <jino.cho@samsung.com>
Change-Id: Ic609b26409268784dc0c46e5e21c3745e179dc1d
-rw-r--r-- | include/linux/compiler-gcc.h | 12 | ||||
-rw-r--r-- | include/linux/compiler-gcc4.h | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 73dcf804b..9896e547b 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__)) diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 94dea3ffb..27d11ca7b 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h @@ -12,7 +12,9 @@ #define __used __attribute__((__used__)) #define __must_check __attribute__((warn_unused_result)) #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) -#define __always_inline inline __attribute__((always_inline)) +#ifndef __always_inline +# define __always_inline inline __attribute__((always_inline)) +#endif /* * A trick to suppress uninitialized variable warning without generating any |