mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Yinghai Lu <Yinghai.Lu@Sun.COM>
Cc: mingo@elte.hu, andi@firstfloor.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] make loglevel related commandline to early_param v2
Date: Fri, 1 Feb 2008 11:56:23 -0800	[thread overview]
Message-ID: <20080201115623.c9f1c85b.akpm@linux-foundation.org> (raw)
In-Reply-To: <200802011135.36475.yinghai.lu@sun.com>

On Fri, 01 Feb 2008 11:35:35 -0800
Yinghai Lu <Yinghai.Lu@Sun.COM> wrote:

> [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

Your earlier patch converted ignore_loglevel but this one no longer does
so.  Was that deliberate?

Below is the patch whcih I presently have queued.  Is it OK?

 init/main.c     |   14 +++++---------
 kernel/printk.c |    5 ++---
 2 files changed, 7 insertions(+), 12 deletions(-)

diff -puN init/main.c~convert-loglevel-related-kernel-boot-parameters-to-early_param init/main.c
--- a/init/main.c~convert-loglevel-related-kernel-boot-parameters-to-early_param
+++ a/init/main.c
@@ -232,22 +232,18 @@ 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)
 {
@@ -255,7 +251,7 @@ static int __init loglevel(char *str)
 	return 1;
 }
 
-__setup("loglevel=", loglevel);
+early_param("loglevel", loglevel);
 
 /*
  * Unknown boot options get handed to init, unless they look like
diff -puN kernel/printk.c~convert-loglevel-related-kernel-boot-parameters-to-early_param kernel/printk.c
--- a/kernel/printk.c~convert-loglevel-related-kernel-boot-parameters-to-early_param
+++ a/kernel/printk.c
@@ -447,11 +447,10 @@ static int __init ignore_loglevel_setup(
 {
 	ignore_loglevel = 1;
 	printk(KERN_INFO "debug: ignoring loglevel setting.\n");
-
-	return 1;
+	return 0;
 }
 
-__setup("ignore_loglevel", ignore_loglevel_setup);
+early_param("ignore_loglevel", ignore_loglevel_setup);
 
 /*
  * Write out chars from start to end - 1 inclusive
_


  reply	other threads:[~2008-02-01 19:56 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   ` [PATCH] make loglevel related commandline to early_param v2 Yinghai Lu
2008-02-01 19:56     ` Andrew Morton [this message]
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=20080201115623.c9f1c85b.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=Yinghai.Lu@Sun.COM \
    --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

all inboxes | Powered by JetHome®