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 *);
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 }
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
17 #define likely(x) __builtin_expect((x),1)
18 #define unlikely(x) __builtin_expect((x),0)
21 +#define __attribute_used__ __attribute__((__used__))
23 +#if __GNUC_MINOR__ >= 3
24 +# define __attribute_used__ __attribute__((__used__))
26 +# define __attribute_used__ __attribute__((__unused__))
27 +#endif /* __GNUC_MINOR__ >= 3 */
29 +#define __attribute_used__ __attribute__((__unused__))
31 +#define __attribute_used__ /* not implemented */
32 +#endif /* __GNUC__ */
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
41 #include <linux/config.h>
42 +#include <linux/compiler.h>
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;
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
55 @@ -67,7 +68,7 @@ extern struct kernel_param __setup_start
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 }
62 #endif /* __ASSEMBLY__ */
64 @@ -77,16 +78,16 @@ extern struct kernel_param __setup_start
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")))
72 -#define __exit __attribute__ ((unused))
73 +#define __exit __attribute_used__
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")))
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
91 #define _LINUX_MODULE_H
93 #include <linux/config.h>
94 +#include <linux/compiler.h>
95 #include <linux/spinlock.h>
96 #include <linux/list.h>
98 @@ -254,9 +255,9 @@ __attribute__((section(".modinfo"))) =
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
109 * The following license idents are currently accepted as indicating free
110 @@ -284,7 +285,7 @@ static const struct gtype##_id * __modul
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"))) = \
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)
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;
127 -static const char __module_using_checksums[] __attribute__((section(".modinfo"))) =
128 +static const char __module_using_checksums[] __attribute_used__ __attribute__((section(".modinfo"))) =
132 @@ -319,7 +320,7 @@ static const char __module_using_checksu
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