All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch] printk: move some loglevel setup functions to kernel/printk.c
@ 2011-01-19  7:29 Amerigo Wang
  2011-01-19 20:18 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Amerigo Wang @ 2011-01-19  7:29 UTC (permalink / raw)
  To: linux-kernel
  Cc: WANG Cong, Ingo Molnar, Andrew Morton, Peter Zijlstra, Tejun Heo,
	Arnd Bergmann, James Morris, Kees Cook, Namhyung Kim

These parameter setup functions should go to kernel/printk.c,
and should also be under CONFIG_PRINTK.

Signed-off-by: WANG Cong <amwang@redhat.com>

---
diff --git a/init/main.c b/init/main.c
index 00799c1..b832b69 100644
--- a/init/main.c
+++ b/init/main.c
@@ -240,29 +240,6 @@ unsigned long loops_per_jiffy = (1<<12);
 
 EXPORT_SYMBOL(loops_per_jiffy);
 
-static int __init debug_kernel(char *str)
-{
-	console_loglevel = 10;
-	return 0;
-}
-
-static int __init quiet_kernel(char *str)
-{
-	console_loglevel = 4;
-	return 0;
-}
-
-early_param("debug", debug_kernel);
-early_param("quiet", quiet_kernel);
-
-static int __init loglevel(char *str)
-{
-	get_option(&str, &console_loglevel);
-	return 0;
-}
-
-early_param("loglevel", loglevel);
-
 /*
  * Unknown boot options get handed to init, unless they look like
  * unused parameters (modprobe will find them in /proc/cmdline).
diff --git a/kernel/printk.c b/kernel/printk.c
index 53d9a9e..e495a2c 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -467,6 +467,30 @@ static void __call_console_drivers(unsigned start, unsigned end)
 	}
 }
 
+static int __init debug_kernel(char *str)
+{
+	console_loglevel = 10;
+	return 0;
+}
+
+early_param("debug", debug_kernel);
+
+static int __init quiet_kernel(char *str)
+{
+	console_loglevel = 4;
+	return 0;
+}
+
+early_param("quiet", quiet_kernel);
+
+static int __init loglevel(char *str)
+{
+	get_option(&str, &console_loglevel);
+	return 0;
+}
+
+early_param("loglevel", loglevel);
+
 static int __read_mostly ignore_loglevel;
 
 static int __init ignore_loglevel_setup(char *str)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Patch] printk: move some loglevel setup functions to kernel/printk.c
  2011-01-19  7:29 [Patch] printk: move some loglevel setup functions to kernel/printk.c Amerigo Wang
@ 2011-01-19 20:18 ` Andrew Morton
  2011-01-20  7:36   ` Cong Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2011-01-19 20:18 UTC (permalink / raw)
  To: Amerigo Wang
  Cc: linux-kernel, Ingo Molnar, Peter Zijlstra, Tejun Heo,
	Arnd Bergmann, James Morris, Kees Cook, Namhyung Kim

> Cc: WANG Cong <amwang@redhat.com>, Ingo Molnar <mingo@elte.hu> (commit_signer:8/43=19%,commit_signer:4/26=15%), Andrew Morton <akpm@linux-foundation.org> (commit_signer:7/43=16%,commit_signer:9/26=35%), Peter Zijlstra <a.p.zijlstra@chello.nl> (commit_signer:5/43=12%), Tejun Heo <tj@kernel.org> (commit_signer:4/43=9%), Arnd Bergmann <arnd@arndb.de> (commit_signer:3/43=7%), James Morris <jmorris@namei.org> (commit_signer:6/26=23%), Kees Cook <kees.cook@canonical.com> (commit_signer:4/26=15%), Namhyung Kim <namhyung@gmail.com> (commit_signer:3/26=12%)

Pease don't do that.

On Wed, 19 Jan 2011 15:29:24 +0800
Amerigo Wang <amwang@redhat.com> wrote:

> These parameter setup functions should go to kernel/printk.c,

That makes sense.

> and should also be under CONFIG_PRINTK.

Not so sure about that.  console_loglevel pertains to the console
system more than to printk.  And the console layer is present even when
CONFIG_PRINTK=n.

Now, it may be that console_loglevel never does anything useful when
CONFIG_PRINTK=n.  In which case one wonders why the console code exists
when CONFIG_PRINTK=n.

Anyway.  I didn't look at all this terribly hard.  Please demonstrate
to us that you did do so :)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch] printk: move some loglevel setup functions to kernel/printk.c
  2011-01-19 20:18 ` Andrew Morton
@ 2011-01-20  7:36   ` Cong Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Cong Wang @ 2011-01-20  7:36 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Ingo Molnar, Peter Zijlstra, Tejun Heo,
	Arnd Bergmann, James Morris, Kees Cook, Namhyung Kim

于 2011年01月20日 04:18, Andrew Morton 写道:
>> Cc: WANG Cong<amwang@redhat.com>, Ingo Molnar<mingo@elte.hu>  (commit_signer:8/43=19%,commit_signer:4/26=15%), Andrew Morton<akpm@linux-foundation.org>  (commit_signer:7/43=16%,commit_signer:9/26=35%), Peter Zijlstra<a.p.zijlstra@chello.nl>  (commit_signer:5/43=12%), Tejun Heo<tj@kernel.org>  (commit_signer:4/43=9%), Arnd Bergmann<arnd@arndb.de>  (commit_signer:3/43=7%), James Morris<jmorris@namei.org>  (commit_signer:6/26=23%), Kees Cook<kees.cook@canonical.com>  (commit_signer:4/26=15%), Namhyung Kim<namhyung@gmail.com>  (commit_signer:3/26=12%)
>
> Pease don't do that.
>

Sorry for this, I used get_maintainers.pl in my script,
and now I fixed my script. :-/

> On Wed, 19 Jan 2011 15:29:24 +0800
> Amerigo Wang<amwang@redhat.com>  wrote:
>
>> These parameter setup functions should go to kernel/printk.c,
>
> That makes sense.
>
>> and should also be under CONFIG_PRINTK.
>
> Not so sure about that.  console_loglevel pertains to the console
> system more than to printk.  And the console layer is present even when
> CONFIG_PRINTK=n.


Such as?

>
> Now, it may be that console_loglevel never does anything useful when
> CONFIG_PRINTK=n.  In which case one wonders why the console code exists
> when CONFIG_PRINTK=n.
>
> Anyway.  I didn't look at all this terribly hard.  Please demonstrate
> to us that you did do so :)
>

With CONFIG_PRINTK=n we still have consoles and can still register
other consoles, but there will be no messages printed from kernel
to console. So, I think "quiet" is only meaningful to CONFIG_PRINTK=y.

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-20  7:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-19  7:29 [Patch] printk: move some loglevel setup functions to kernel/printk.c Amerigo Wang
2011-01-19 20:18 ` Andrew Morton
2011-01-20  7:36   ` Cong Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.