[PATCH] Allow early_param and identical __setup to exist
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 26 Sep 2006 08:52:32 +0000 (10:52 +0200)
committerAndi Kleen <andi@basil.nowhere.org>
Tue, 26 Sep 2006 08:52:32 +0000 (10:52 +0200)
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>
init/main.c

index 8651a720a092c4ade7e530c01b57b040c3e52539..6b69564738c19215b88fae6753f9ab77035c9fa3 100644 (file)
@@ -162,16 +162,19 @@ extern struct obs_kernel_param __setup_start[], __setup_end[];
 static int __init obsolete_checksetup(char *line)
 {
        struct obs_kernel_param *p;
+       int had_early_param = 0;
 
        p = __setup_start;
        do {
                int n = strlen(p->str);
                if (!strncmp(line, p->str, n)) {
                        if (p->early) {
-                               /* Already done in parse_early_param?  (Needs
-                                * exact match on param part) */
+                               /* Already done in parse_early_param?
+                                * (Needs exact match on param part).
+                                * Keep iterating, as we can have early
+                                * params and __setups of same names 8( */
                                if (line[n] == '\0' || line[n] == '=')
-                                       return 1;
+                                       had_early_param = 1;
                        } else if (!p->setup_func) {
                                printk(KERN_WARNING "Parameter %s is obsolete,"
                                       " ignored\n", p->str);
@@ -181,7 +184,8 @@ static int __init obsolete_checksetup(char *line)
                }
                p++;
        } while (p < __setup_end);
-       return 0;
+
+       return had_early_param;
 }
 
 /*