aboutsummaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2006-09-26 04:52:32 -0400
committerAndi Kleen <andi@basil.nowhere.org>2006-09-26 04:52:32 -0400
commit33df0d19ea425d28bd5afb48898af32237fe81af (patch)
tree98305a70ad02fd680fd1bb21eedb08c51df17823 /init/main.c
parent9ca33eb6981549c0d1b7aea7f99f1ba602161356 (diff)
[PATCH] Allow early_param and identical __setup to exist
We currently assume that boot parameters which are handled by early_param() will not overlap boot parameters handled by __setup: if they do, behaviour is dependent on link order, usually meaning __setup will not get called. ACPI wants to use early_param("pci"), and pci uses __setup("pci="), so we modify the core to let them coexist: "pci=noacpi" will now get passed to both. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'init/main.c')
-rw-r--r--init/main.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/init/main.c b/init/main.c
index 8651a720a092..6b69564738c1 100644
--- a/init/main.c
+++ b/init/main.c
@@ -162,16 +162,19 @@ extern struct obs_kernel_param __setup_start[], __setup_end[];
162static int __init obsolete_checksetup(char *line) 162static int __init obsolete_checksetup(char *line)
163{ 163{
164 struct obs_kernel_param *p; 164 struct obs_kernel_param *p;
165 int had_early_param = 0;
165 166
166 p = __setup_start; 167 p = __setup_start;
167 do { 168 do {
168 int n = strlen(p->str); 169 int n = strlen(p->str);
169 if (!strncmp(line, p->str, n)) { 170 if (!strncmp(line, p->str, n)) {
170 if (p->early) { 171 if (p->early) {
171 /* Already done in parse_early_param? (Needs 172 /* Already done in parse_early_param?
172 * exact match on param part) */ 173 * (Needs exact match on param part).
174 * Keep iterating, as we can have early
175 * params and __setups of same names 8( */
173 if (line[n] == '\0' || line[n] == '=') 176 if (line[n] == '\0' || line[n] == '=')
174 return 1; 177 had_early_param = 1;
175 } else if (!p->setup_func) { 178 } else if (!p->setup_func) {
176 printk(KERN_WARNING "Parameter %s is obsolete," 179 printk(KERN_WARNING "Parameter %s is obsolete,"
177 " ignored\n", p->str); 180 " ignored\n", p->str);
@@ -181,7 +184,8 @@ static int __init obsolete_checksetup(char *line)
181 } 184 }
182 p++; 185 p++;
183 } while (p < __setup_end); 186 } while (p < __setup_end);
184 return 0; 187
188 return had_early_param;
185} 189}
186 190
187/* 191/*