]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
compiler_gcc: do not redefine __gnu_attributes
authorJeroen Hofstee <jeroen@myspectrum.nl>
Sat, 10 Aug 2013 15:16:50 +0000 (17:16 +0200)
committerTom Rini <trini@ti.com>
Fri, 6 Sep 2013 17:09:07 +0000 (13:09 -0400)
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>
include/linux/compiler-gcc.h
include/linux/compiler-gcc4.h

index 73dcf804bc940e6738f5f0f553f3cf2045f78fd7..9896e547b94ec0120863700dc3dde914c93c5bb5 100644 (file)
@@ -50,7 +50,9 @@
 #endif
 
 #define __deprecated                   __attribute__((deprecated))
-#define __packed                       __attribute__((packed))
+#ifndef __packed
+# define __packed                      __attribute__((packed))
+#endif
 #define __weak                         __attribute__((weak))
 
 /*
  * 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__))
index 94dea3ffbfa19576e2cd8bb59b56658465101b49..27d11ca7b08f398b68a372104748384248d0b1db 100644 (file)
@@ -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