aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/init.h
diff options
context:
space:
mode:
authorMatthew Leach <matthew@mattleach.net>2012-12-17 18:59:32 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-17 20:15:12 -0500
commit7929d407e47fbf843fe1337fd95ed57785ae5e9d (patch)
tree5c94b07b1d60cbf2499ec59f89c61a2113ea753f /include/linux/init.h
parentfbb97d87802247a7bb32a207a8275372e79e6b88 (diff)
include/linux/init.h: use the stringify operator for the __define_initcall macro
Currently the __define_initcall() macro takes three arguments, fn, id and level. The level argument is exactly the same as the id argument but wrapped in quotes. To overcome this need to specify three arguments to the __define_initcall macro, where one argument is the stringification of another, we can just use the stringification macro instead. Signed-off-by: Matthew Leach <matthew@mattleach.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/init.h')
-rw-r--r--include/linux/init.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/include/linux/init.h b/include/linux/init.h
index f63692d6902e..a799273714ac 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -182,16 +182,16 @@ extern bool initcall_debug;
182 * can point at the same handler without causing duplicate-symbol build errors. 182 * can point at the same handler without causing duplicate-symbol build errors.
183 */ 183 */
184 184
185#define __define_initcall(level,fn,id) \ 185#define __define_initcall(fn, id) \
186 static initcall_t __initcall_##fn##id __used \ 186 static initcall_t __initcall_##fn##id __used \
187 __attribute__((__section__(".initcall" level ".init"))) = fn 187 __attribute__((__section__(".initcall" #id ".init"))) = fn
188 188
189/* 189/*
190 * Early initcalls run before initializing SMP. 190 * Early initcalls run before initializing SMP.
191 * 191 *
192 * Only for built-in code, not modules. 192 * Only for built-in code, not modules.
193 */ 193 */
194#define early_initcall(fn) __define_initcall("early",fn,early) 194#define early_initcall(fn) __define_initcall(fn, early)
195 195
196/* 196/*
197 * A "pure" initcall has no dependencies on anything else, and purely 197 * A "pure" initcall has no dependencies on anything else, and purely
@@ -200,23 +200,23 @@ extern bool initcall_debug;
200 * This only exists for built-in code, not for modules. 200 * This only exists for built-in code, not for modules.
201 * Keep main.c:initcall_level_names[] in sync. 201 * Keep main.c:initcall_level_names[] in sync.
202 */ 202 */
203#define pure_initcall(fn) __define_initcall("0",fn,0) 203#define pure_initcall(fn) __define_initcall(fn, 0)
204 204
205#define core_initcall(fn) __define_initcall("1",fn,1) 205#define core_initcall(fn) __define_initcall(fn, 1)
206#define core_initcall_sync(fn) __define_initcall("1s",fn,1s) 206#define core_initcall_sync(fn) __define_initcall(fn, 1s)
207#define postcore_initcall(fn) __define_initcall("2",fn,2) 207#define postcore_initcall(fn) __define_initcall(fn, 2)
208#define postcore_initcall_sync(fn) __define_initcall("2s",fn,2s) 208#define postcore_initcall_sync(fn) __define_initcall(fn, 2s)
209#define arch_initcall(fn) __define_initcall("3",fn,3) 209#define arch_initcall(fn) __define_initcall(fn, 3)
210#define arch_initcall_sync(fn) __define_initcall("3s",fn,3s) 210#define arch_initcall_sync(fn) __define_initcall(fn, 3s)
211#define subsys_initcall(fn) __define_initcall("4",fn,4) 211#define subsys_initcall(fn) __define_initcall(fn, 4)
212#define subsys_initcall_sync(fn) __define_initcall("4s",fn,4s) 212#define subsys_initcall_sync(fn) __define_initcall(fn, 4s)
213#define fs_initcall(fn) __define_initcall("5",fn,5) 213#define fs_initcall(fn) __define_initcall(fn, 5)
214#define fs_initcall_sync(fn) __define_initcall("5s",fn,5s) 214#define fs_initcall_sync(fn) __define_initcall(fn, 5s)
215#define rootfs_initcall(fn) __define_initcall("rootfs",fn,rootfs) 215#define rootfs_initcall(fn) __define_initcall(fn, rootfs)
216#define device_initcall(fn) __define_initcall("6",fn,6) 216#define device_initcall(fn) __define_initcall(fn, 6)
217#define device_initcall_sync(fn) __define_initcall("6s",fn,6s) 217#define device_initcall_sync(fn) __define_initcall(fn, 6s)
218#define late_initcall(fn) __define_initcall("7",fn,7) 218#define late_initcall(fn) __define_initcall(fn, 7)
219#define late_initcall_sync(fn) __define_initcall("7s",fn,7s) 219#define late_initcall_sync(fn) __define_initcall(fn, 7s)
220 220
221#define __initcall(fn) device_initcall(fn) 221#define __initcall(fn) device_initcall(fn)
222 222