public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Andi Kleen <ak@suse.de>
Cc: Andrew Morton <akpm@osdl.org>,
	Xen-devel <xen-devel@lists.xensource.com>,
	Ian Pratt <ian.pratt@xensource.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Chris Wright <chrisw@sous-sol.org>,
	virtualization@lists.osdl.org,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Christoph Lameter <clameter@sgi.com>
Subject: [PATCH 1/2] Allow early_param and identical __setup to exist
Date: Wed, 02 Aug 2006 19:06:47 +1000	[thread overview]
Message-ID: <1154509608.10326.2.camel@localhost.localdomain> (raw)
In-Reply-To: <200608020724.23583.ak@suse.de>

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>

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.6.18-rc2-mm1/init/main.c working-2.6.18-rc2-mm1-i386-parse_early_param/init/main.c
--- linux-2.6.18-rc2-mm1/init/main.c	2006-08-01 14:12:11.000000000 +1000
+++ working-2.6.18-rc2-mm1-i386-parse_early_param/init/main.c	2006-08-02 16:48:39.000000000 +1000
@@ -182,16 +182,19 @@ extern struct obs_kernel_param __setup_s
 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);
@@ -201,7 +204,8 @@ static int __init obsolete_checksetup(ch
 		}
 		p++;
 	} while (p < __setup_end);
-	return 0;
+
+	return had_early_param;
 }
 
 /*

-- 
Help! Save Australia from the worst of the DMCA: http://linux.org.au/law


  reply	other threads:[~2006-08-02  9:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0adfc39039c79e4f4121.1154462446@ezr>
2006-08-01 21:47 ` [PATCH 8 of 13] Add a bootparameter to reserve high linear address space for hypervisors Andi Kleen
2006-08-02  0:48   ` Rusty Russell
2006-08-02  2:59     ` Andi Kleen
2006-08-02  3:54       ` [Xen-devel] " Rusty Russell
2006-08-02  4:21         ` Andi Kleen
2006-08-02  4:33           ` Rusty Russell
2006-08-02  4:36             ` Andi Kleen
2006-08-02  5:20               ` Rusty Russell
2006-08-02  5:24                 ` Andi Kleen
2006-08-02  9:06                   ` Rusty Russell [this message]
2006-08-02  9:08                   ` [PATCH 2/2] Replace i386 open-coded cmdline parsing with early_param/parse_early_param Rusty Russell
2006-08-02  9:24                     ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1154509608.10326.2.camel@localhost.localdomain \
    --to=rusty@rustcorp.com.au \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=chrisw@sous-sol.org \
    --cc=clameter@sgi.com \
    --cc=ebiederm@xmission.com \
    --cc=ian.pratt@xensource.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.osdl.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox