public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yinghai Lu <Yinghai.Lu@Sun.COM>
To: Andrew Morton <akpm@linux-foundation.org>, Ingo Molnar <mingo@elte.hu>
Cc: Andi Kleen <andi@firstfloor.org>, linux-kernel@vger.kernel.org
Subject: [PATCH] make loglevel related commandline to early_param v2
Date: Fri, 01 Feb 2008 11:35:35 -0800	[thread overview]
Message-ID: <200802011135.36475.yinghai.lu@sun.com> (raw)
In-Reply-To: <p73bq704zqs.fsf@bingen.suse.de>

[PATCH] make loglevel related commandline to early_param v2

so we can use them for early console like 
console=uart8250,io,0x3f8,115200n8
earlycon=uart8250,io,0x3f8,115200n8
early_printk

otherwise printk(KERN_DEBUG "debug msg") will not print out to console even
"debug" command line is used.

andi point out early_param need to return 0 instead 1.

Ingo had another patch in x86.git to process ignore_loglevel

Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>

diff --git a/init/main.c b/init/main.c
index cb81ed1..3741bda 100644
--- a/init/main.c
+++ b/init/main.c
@@ -232,30 +232,26 @@ EXPORT_SYMBOL(loops_per_jiffy);
 
 static int __init debug_kernel(char *str)
 {
-	if (*str)
-		return 0;
 	console_loglevel = 10;
-	return 1;
+	return 0;
 }
 
 static int __init quiet_kernel(char *str)
 {
-	if (*str)
-		return 0;
 	console_loglevel = 4;
-	return 1;
+	return 0;
 }
 
-__setup("debug", debug_kernel);
-__setup("quiet", quiet_kernel);
+early_param("debug", debug_kernel);
+early_param("quiet", quiet_kernel);
 
 static int __init loglevel(char *str)
 {
 	get_option(&str, &console_loglevel);
-	return 1;
+	return 0;
 }
 
-__setup("loglevel=", loglevel);
+early_param("loglevel", loglevel);
 
 /*
  * Unknown boot options get handed to init, unless they look like

  parent reply	other threads:[~2008-02-01 19:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-01 10:40 [PATCH] make loglevel related commandline to early_param Yinghai Lu
2008-02-01 12:39 ` Andi Kleen
2008-02-01 18:51   ` Yinghai Lu
2008-02-01 19:35   ` Yinghai Lu [this message]
2008-02-01 19:56     ` [PATCH] make loglevel related commandline to early_param v2 Andrew Morton
2008-02-01 20:21       ` Yinghai Lu

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=200802011135.36475.yinghai.lu@sun.com \
    --to=yinghai.lu@sun.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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