linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Minchan Kim <barrioskmc@gmail.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Minchan Kim <minchan.kim@gmail.com>,
	akpm@linux-foundation.org, Randy Dunlap <randy.dunlap@oracle.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Christoph Lameter <cl@linux-foundation.org>,
	linux-mm@kvack.org, Dave Hansen <dave@linux.vnet.ibm.com>,
	"David S. Miller" <davem@davemloft.net>,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	Ingo Molnar <mingo@elte.hu>, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][mmtom] clean up once printk routine
Date: Tue, 26 May 2009 18:40:35 +0900	[thread overview]
Message-ID: <44c63dc40905260240n2c4e348ai74b7d42954098bf1@mail.gmail.com> (raw)
In-Reply-To: <20090526083538.GA29563@elf.ucw.cz>

Hi, Pavel.

On Tue, May 26, 2009 at 5:35 PM, Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
>> Yes. There are also some places to be able to use printk_once().
>> Are there any place I missed ?
>>
>> == CUT HERE ==
>>
>> There are some places to be able to use printk_once instead of hard coding.
>>
>> It will help code readability and maintenance.
>> This patch doesn't change function's behavior.
>>
>> Signed-off-by: Minchan Kim <minchan.kim@gmail.com>
>> CC: Dominik Brodowski <linux@dominikbrodowski.net>
>> CC: David S. Miller <davem@davemloft.net>
>> CC: Ingo Molnar <mingo@elte.hu>
>> ---
>>  arch/x86/kernel/cpu/common.c  |    8 ++------
>>  drivers/net/3c515.c           |    7 ++-----
>>  drivers/pcmcia/pcmcia_ioctl.c |    9 +++------
>>  3 files changed, 7 insertions(+), 17 deletions(-)
>>
>> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
>> index 82bec86..dc0f694 100644
>> --- a/arch/x86/kernel/cpu/common.c
>> +++ b/arch/x86/kernel/cpu/common.c
>> @@ -496,13 +496,9 @@ static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c)
>>               }
>>       }
>>
>> -     if (!printed) {
>> -             printed++;
>> -             printk(KERN_ERR
>> +     printk_once(KERN_ERR
>>                   "CPU: vendor_id '%s' unknown, using generic init.\n", v);
>> -
>> -             printk(KERN_ERR "CPU: Your system may be unstable.\n");
>> -     }
>> +     printk_once(KERN_ERR "CPU: Your system may be unstable.\n");
>>
>
> You should delete the variable, right?

Yes. you're right.

> Plus, the code now uses two variables instead of one.
>
>                                                                        Pavel

Thanks for pointing me out.
I will repost the patch with your advise.


> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
>



-- 
Thanks,
Minchan Kim

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2009-05-26  9:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-26  4:57 Minchan Kim
2009-05-26  6:52 ` KOSAKI Motohiro
2009-05-26  6:59   ` Minchan Kim
2009-05-26 20:41     ` Andrew Morton
2009-05-26 23:31       ` [PATCH][mmtom] clean up printk_once of get_cpu_vendor Minchan Kim
2009-05-26  8:35 ` [PATCH][mmtom] clean up once printk routine Pavel Machek
2009-05-26  9:40   ` Minchan Kim [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=44c63dc40905260240n2c4e348ai74b7d42954098bf1@mail.gmail.com \
    --to=barrioskmc@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux-foundation.org \
    --cc=dave@linux.vnet.ibm.com \
    --cc=davem@davemloft.net \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@dominikbrodowski.net \
    --cc=minchan.kim@gmail.com \
    --cc=mingo@elte.hu \
    --cc=pavel@ucw.cz \
    --cc=randy.dunlap@oracle.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