mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 管雪涛 <gxt@pku.edu.cn>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: xypron glpk <xypron.glpk@gmx.de>,
	gxt@mprc.pku.edu.cn,
	paul gortmaker <paul.gortmaker@windriver.com>,
	vapier@gentoo.org, totglx@linutronix.de,
	linux-kernel@vger.kernel.org
Subject: 回复: Re: [PATCH 1/1] __init setup_early_printk: missing initialization
Date: Tue, 28 Jan 2014 16:05:07 +0800 (CST)	[thread overview]
Message-ID: <182670498.15705.1390896307427.JavaMail.root@bj-mail03.pku.edu.cn> (raw)
In-Reply-To: <20140127134959.72c65d0091554e36d1755ab0@linux-foundation.org>

Thanks.

Acked-by: Xuetao Guan <gxt@mprc.pku.edu.cn>

----- Andrew Morton <akpm@linux-foundation.org> 写道:
> On Mon, 27 Jan 2014 19:10:24 +0100 xypron.glpk@gmx.de wrote:
> 
> > From: Heinrich Schuchardt <xypron.glpk@gmx.de>
> > 
> > If is based on uninitialized value keep_early.
> > This leads to unpredictable result.
> > 
> > ...
> >
> > --- a/arch/unicore32/kernel/early_printk.c
> > +++ b/arch/unicore32/kernel/early_printk.c
> > @@ -35,7 +35,7 @@ static struct console early_ocd_console = {
> >  
> >  static int __init setup_early_printk(char *buf)
> >  {
> > -	int keep_early;
> > +	int keep_early = 0;
> >  
> >  	if (!buf || early_console)
> >  		return 0;
> 
> yup.
> 
> But that code is quite overcooked.  How about this?
> 
> --- a/arch/unicore32/kernel/early_printk.c~arch-unicore32-kernel-early_printkc-setup_early_printk-missing-initialization-fix
> +++ a/arch/unicore32/kernel/early_printk.c
> @@ -35,17 +35,11 @@ static struct console early_ocd_console
>  
>  static int __init setup_early_printk(char *buf)
>  {
> -	int keep_early = 0;
> -
>  	if (!buf || early_console)
>  		return 0;
>  
> -	if (strstr(buf, "keep"))
> -		keep_early = 1;
> -
>  	early_console = &early_ocd_console;
> -
> -	if (keep_early)
> +	if (strstr(buf, "keep"))
>  		early_console->flags &= ~CON_BOOT;
>  	else
>  		early_console->flags |= CON_BOOT;
> _
> 


      parent reply	other threads:[~2014-01-28  8:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-27 18:10 xypron.glpk
2014-01-27 21:49 ` Andrew Morton
2014-01-27 22:58   ` Heinrich Schuchardt
2014-01-28  8:05   ` 管雪涛 [this message]

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=182670498.15705.1390896307427.JavaMail.root@bj-mail03.pku.edu.cn \
    --to=gxt@pku.edu.cn \
    --cc=akpm@linux-foundation.org \
    --cc=gxt@mprc.pku.edu.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=totglx@linutronix.de \
    --cc=vapier@gentoo.org \
    --cc=xypron.glpk@gmx.de \
    /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®