mac80211: initialize sinfo in cfg80211_get_station
[openwrt/staging/blogic.git] / package / boot / uboot-imx6 / patches / 102-compiler_gcc-prevent-redefining-attributes.patch
1 From 0a5051ce6ebd5f6fad58fd50d6922493d8447f14 Mon Sep 17 00:00:00 2001
2 From: Jeroen Hofstee <jeroen@myspectrum.nl>
3 Date: Thu, 18 Sep 2014 20:10:27 +0200
4 Subject: compiler_gcc: prevent redefining attributes
5
6 The libc headers on FreeBSD and likely related projects as well contain an
7 header file, cdefs.h which provides similiar functionality as linux/compiler.h.
8 It provides compiler independent defines like __weak __packed, to allow
9 compiling with multiple compilers which might have a different syntax for such
10 extension.
11
12 Since that header file is included in multiple standard headers, like stddef.h
13 and stdarg.h, multiple definitions of those defines will be present if both are
14 included. When compiling u-boot the compiler will warn about it hundreds of
15 times since e.g. common.h will include both files indirectly.
16
17 commit 7ea50d52849fe8ffa5b5b74c979b60b1045d6fc9 "compiler_gcc: do not redefine
18 __gnu_attributes" prevented such redefinitions, but this was undone by commit
19 fb8ffd7cfc68b3dc44e182356a207d784cb30b34 "compiler*.h: sync
20 include/linux/compiler*.h with Linux 3.16".
21
22 Add the checks back where necessary to prevent such warnings.
23
24 As the original patch this checkpatch warning is ignored:
25 "WARNING: Adding new packed members is to be done with care"
26
27 Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
28 Cc: Tom Rini <trini@ti.com>
29 Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
30 Acked-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
31 ---
32 include/linux/compiler-gcc.h | 10 ++++++++++
33 1 file changed, 10 insertions(+)
34
35 --- a/include/linux/compiler-gcc.h
36 +++ b/include/linux/compiler-gcc.h
37 @@ -64,8 +64,12 @@
38 #endif
39
40 #define __deprecated __attribute__((deprecated))
41 +#ifndef __packed
42 #define __packed __attribute__((packed))
43 +#endif
44 +#ifndef __weak
45 #define __weak __attribute__((weak))
46 +#endif
47
48 /*
49 * it doesn't make sense on ARM (currently the only user of __naked) to trace
50 @@ -91,8 +95,12 @@
51 * would be.
52 * [...]
53 */
54 +#ifndef __pure
55 #define __pure __attribute__((pure))
56 +#endif
57 +#ifndef __aligned
58 #define __aligned(x) __attribute__((aligned(x)))
59 +#endif
60 #define __printf(a, b) __attribute__((format(printf, a, b)))
61 #define __scanf(a, b) __attribute__((format(scanf, a, b)))
62 #define noinline __attribute__((noinline))
63 @@ -115,4 +123,6 @@
64 */
65 #define uninitialized_var(x) x = x
66
67 +#ifndef __always_inline
68 #define __always_inline inline __attribute__((always_inline))
69 +#endif