]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/linux/nslu2-linksys-kernel-2.4.22/linux-2.4.24-attribute-used.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / linux / nslu2-linksys-kernel-2.4.22 / linux-2.4.24-attribute-used.patch
1 diff -purN linux-2.4.24-uc0.orig/include/asm-arm/setup.h linux-2.4.24-uc0/include/asm-arm/setup.h
2 --- linux-2.4.24-uc0.orig/include/asm-arm/setup.h       2003-08-25 04:44:43.000000000 -0700
3 +++ linux-2.4.24-uc0/include/asm-arm/setup.h    2004-09-09 04:36:03.000000000 -0700
4 @@ -236,7 +236,7 @@ struct tagtable {
5         int (*parse)(const struct tag *);
6  };
7  
8 -#define __tag __attribute__((unused, __section__(".taglist")))
9 +#define __tag __attribute_used__ __attribute__((__section__(".taglist")))
10  #define __tagtable(tag, fn) \
11  static struct tagtable __tagtable_##fn __tag = { tag, fn }
12  
13 diff -purN linux-2.4.24-uc0.orig/include/linux/compiler.h linux-2.4.24-uc0/include/linux/compiler.h
14 --- linux-2.4.24-uc0.orig/include/linux/compiler.h      2004-03-31 21:52:49.000000000 -0800
15 +++ linux-2.4.24-uc0/include/linux/compiler.h   2004-09-09 01:33:29.000000000 -0700
16 @@ -13,4 +13,18 @@
17  #define likely(x)      __builtin_expect((x),1)
18  #define unlikely(x)    __builtin_expect((x),0)
19  
20 +#if __GNUC__ > 3
21 +#define __attribute_used__     __attribute__((__used__))
22 +#elif __GNUC__ == 3
23 +#if  __GNUC_MINOR__ >= 3
24 +# define __attribute_used__    __attribute__((__used__))
25 +#else
26 +# define __attribute_used__    __attribute__((__unused__))
27 +#endif /* __GNUC_MINOR__ >= 3 */
28 +#elif __GNUC__ == 2
29 +#define __attribute_used__     __attribute__((__unused__))
30 +#else
31 +#define __attribute_used__     /* not implemented */
32 +#endif /* __GNUC__ */
33 +
34  #endif /* __LINUX_COMPILER_H */
35 diff -purN linux-2.4.24-uc0.orig/include/linux/init.h linux-2.4.24-uc0/include/linux/init.h
36 --- linux-2.4.24-uc0.orig/include/linux/init.h  2004-03-31 21:52:50.000000000 -0800
37 +++ linux-2.4.24-uc0/include/linux/init.h       2004-09-09 01:38:11.000000000 -0700
38 @@ -2,6 +2,7 @@
39  #define _LINUX_INIT_H
40  
41  #include <linux/config.h>
42 +#include <linux/compiler.h>
43  
44  /* These macros are used to mark some functions or 
45   * initialized data (doesn't apply to uninitialized data)
46 @@ -51,7 +52,7 @@ typedef void (*exitcall_t)(void);
47  extern initcall_t __initcall_start, __initcall_end;
48  
49  #define __initcall(fn)                                                         \
50 -       static initcall_t __initcall_##fn __init_call = fn
51 +       static initcall_t __initcall_##fn __attribute_used__ __init_call = fn
52  #define __exitcall(fn)                                                         \
53         static exitcall_t __exitcall_##fn __exit_call = fn
54  
55 @@ -67,7 +68,7 @@ extern struct kernel_param __setup_start
56  
57  #define __setup(str, fn)                                                               \
58         static char __setup_str_##fn[] __initdata = str;                                \
59 -       static struct kernel_param __setup_##fn __attribute__((unused)) __initsetup = { __setup_str_##fn, fn }
60 +       static struct kernel_param __setup_##fn __attribute_used__ __initsetup = { __setup_str_##fn, fn }
61  
62  #endif /* __ASSEMBLY__ */
63  
64 @@ -77,16 +78,16 @@ extern struct kernel_param __setup_start
65   */
66  #ifndef NO_TEXT_SECTIONS
67  #define __init         __attribute__ ((__section__ (".text.init")))
68 -#define __exit         __attribute__ ((unused, __section__(".text.exit")))
69 +#define __exit         __attribute_used__ __attribute__ ((__section__(".text.exit")))
70  #else
71  #define __init
72 -#define __exit         __attribute__ ((unused))
73 +#define __exit         __attribute_used__
74  #endif
75  #define __initdata     __attribute__ ((__section__ (".data.init")))
76 -#define __exitdata     __attribute__ ((unused, __section__ (".data.exit")))
77 -#define __initsetup    __attribute__ ((unused,__section__ (".setup.init")))
78 -#define __init_call    __attribute__ ((unused,__section__ (".initcall.init")))
79 -#define __exit_call    __attribute__ ((unused,__section__ (".exitcall.exit")))
80 +#define __exitdata     __attribute_used__ __attribute__ ((__section__ (".data.exit")))
81 +#define __initsetup    __attribute_used__ __attribute__ ((__section__ (".setup.init")))
82 +#define __init_call    __attribute_used__ __attribute__ ((__section__ (".initcall.init")))
83 +#define __exit_call    __attribute_used__ __attribute__ ((__section__ (".exitcall.exit")))
84  
85  /* For assembly routines */
86  #define __INIT         .section        ".text.init","ax"
87 diff -purN linux-2.4.24-uc0.orig/include/linux/module.h linux-2.4.24-uc0/include/linux/module.h
88 --- linux-2.4.24-uc0.orig/include/linux/module.h        2002-08-02 17:39:45.000000000 -0700
89 +++ linux-2.4.24-uc0/include/linux/module.h     2004-09-09 03:15:30.000000000 -0700
90 @@ -8,6 +8,7 @@
91  #define _LINUX_MODULE_H
92  
93  #include <linux/config.h>
94 +#include <linux/compiler.h>
95  #include <linux/spinlock.h>
96  #include <linux/list.h>
97  
98 @@ -254,9 +255,9 @@ __attribute__((section(".modinfo"))) =              
99   */
100  #define MODULE_GENERIC_TABLE(gtype,name)       \
101  static const unsigned long __module_##gtype##_size \
102 -  __attribute__ ((unused)) = sizeof(struct gtype##_id); \
103 +  __attribute_used__ = sizeof(struct gtype##_id); \
104  static const struct gtype##_id * __module_##gtype##_table \
105 -  __attribute__ ((unused)) = name
106 +  __attribute_used__ = name
107  
108  /*
109   * The following license idents are currently accepted as indicating free
110 @@ -284,7 +285,7 @@ static const struct gtype##_id * __modul
111   */
112   
113  #define MODULE_LICENSE(license)        \
114 -static const char __module_license[] __attribute__((section(".modinfo"))) =   \
115 +static const char __module_license[] __attribute_used__ __attribute__((section(".modinfo"))) =   \
116  "license=" license
117  
118  /* Define the module variable, and usage macros.  */
119 @@ -296,10 +297,10 @@ extern struct module __this_module;
120  #define MOD_IN_USE             __MOD_IN_USE(THIS_MODULE)
121  
122  #include <linux/version.h>
123 -static const char __module_kernel_version[] __attribute__((section(".modinfo"))) =
124 +static const char __module_kernel_version[] __attribute_used__ __attribute__((section(".modinfo"))) =
125  "kernel_version=" UTS_RELEASE;
126  #ifdef MODVERSIONS
127 -static const char __module_using_checksums[] __attribute__((section(".modinfo"))) =
128 +static const char __module_using_checksums[] __attribute_used__ __attribute__((section(".modinfo"))) =
129  "using_checksums=1";
130  #endif
131  
132 @@ -319,7 +320,7 @@ static const char __module_using_checksu
133   */
134  #define MODULE_GENERIC_TABLE(gtype,name) \
135  static const struct gtype##_id * __module_##gtype##_table \
136 -  __attribute__ ((unused, __section__(".data.exit"))) = name
137 +  __attribute_used__ __attribute__ ((__section__(".data.exit"))) = name
138  
139  #ifndef __GENKSYMS__
140