[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150305074455.GA5969@gmail.com>
Date: Thu, 5 Mar 2015 08:44:56 +0100
From: Ingo Molnar <mingo@...nel.org>
To: "Luis R. Rodriguez" <mcgrof@...not-panic.com>
Cc: gregkh@...uxfoundation.org, akpm@...ux-foundation.org,
tony@...mide.com, tglx@...utronix.de, mingo@...hat.com,
hpa@...or.com, jgross@...e.com, luto@...capital.net,
toshi.kani@...com, dave.hansen@...ux.intel.com, JBeulich@...e.com,
pavel@....cz, qiuxishi@...wei.com, david.vrabel@...rix.com,
bp@...e.de, vbabka@...e.cz, iamjoonsoo.kim@....com,
decui@...rosoft.com, linux-kernel@...r.kernel.org, x86@...nel.org,
julia.lawall@...6.fr, "Luis R. Rodriguez" <mcgrof@...e.com>
Subject: [PATCH 7/4] init.h: Clean up the __setup()/early_param() macros
Make it all a bit easier on the eyes:
- Move the __setup_param() lines right after their init functions
- Use consistent vertical spacing
- Use more horizontal spacing to make it look like regular C code
- Use standard comment style
Cc: Luis R. Rodriguez <mcgrof@...e.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Borislav Petkov <bp@...e.de>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>
Cc: David Vrabel <david.vrabel@...rix.com>
Cc: Dexuan Cui <decui@...rosoft.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Jan Beulich <JBeulich@...e.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@....com>
Cc: Juergen Gross <jgross@...e.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Pavel Machek <pavel@....cz>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Tony Lindgren <tony@...mide.com>
Cc: Toshi Kani <toshi.kani@...com>
Cc: Vlastimil Babka <vbabka@...e.cz>
Cc: Xishi Qiu <qiuxishi@...wei.com>
Cc: julia.lawall@...6.fr
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
include/linux/init.h | 49 +++++++++++++++++++++++++++----------------------
1 file changed, 27 insertions(+), 22 deletions(-)
diff --git a/include/linux/init.h b/include/linux/init.h
index bc11ff96f336..21b6d768edd7 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -253,34 +253,39 @@ struct obs_kernel_param {
* obs_kernel_param "array" too far apart in .init.setup.
*/
#define __setup_param(str, unique_id, fn, early) \
- static const char __setup_str_##unique_id[] __initconst \
- __aligned(1) = str; \
- static struct obs_kernel_param __setup_##unique_id \
- __used __section(.init.setup) \
- __attribute__((aligned((sizeof(long))))) \
+ static const char __setup_str_##unique_id[] __initconst \
+ __aligned(1) = str; \
+ static struct obs_kernel_param __setup_##unique_id \
+ __used __section(.init.setup) \
+ __attribute__((aligned((sizeof(long))))) \
= { __setup_str_##unique_id, fn, early }
-#define __setup(str, fn) \
+#define __setup(str, fn) \
__setup_param(str, fn, fn, 0)
-/* NOTE: fn is as per module_param, not __setup! Emits warning if fn
- * returns non-zero. */
-#define early_param(str, fn) \
+/*
+ * NOTE: fn is as per module_param, not __setup!
+ * Emits warning if fn returns non-zero.
+ */
+#define early_param(str, fn) \
__setup_param(str, fn, fn, 1)
-#define early_param_on_off(str_on, str_off, var, config) \
- int var = IS_ENABLED(config); \
- static int __init parse_##var##_on(char *arg) \
- { \
- var = 1; \
- return 0; \
- } \
- static int __init parse_##var##_off(char *arg) \
- { \
- var = 0; \
- return 0; \
- } \
- __setup_param(str_on, parse_##var##_on, parse_##var##_on, 1); \
+#define early_param_on_off(str_on, str_off, var, config) \
+ \
+ int var = IS_ENABLED(config); \
+ \
+ static int __init parse_##var##_on(char *arg) \
+ { \
+ var = 1; \
+ return 0; \
+ } \
+ __setup_param(str_on, parse_##var##_on, parse_##var##_on, 1); \
+ \
+ static int __init parse_##var##_off(char *arg) \
+ { \
+ var = 0; \
+ return 0; \
+ } \
__setup_param(str_off, parse_##var##_off, parse_##var##_off, 1)
/* Relies on boot_command_line being set */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists