From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755335AbZEZJkn (ORCPT ); Tue, 26 May 2009 05:40:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753331AbZEZJkg (ORCPT ); Tue, 26 May 2009 05:40:36 -0400 Received: from mail-gx0-f166.google.com ([209.85.217.166]:50787 "EHLO mail-gx0-f166.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751200AbZEZJkf convert rfc822-to-8bit (ORCPT ); Tue, 26 May 2009 05:40:35 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=doA/l+mDiq52oVmDkALuyzRZw8kSpuJNlb36d+gDB16Kq6F+erVzGv8+KkDwUB0mxF l/WJLZjB8pCbuAxrvoeCK2ZlRcbT5mV2G09zwvbBdRYUlmnvK9ZpnP2PQWI25iXt1dr1 O4xWL9j6+82xVqH8JoWcBi+XAnJ9KW0cEF1M4= MIME-Version: 1.0 In-Reply-To: <20090526083538.GA29563@elf.ucw.cz> References: <20090526135733.3c38f758.minchan.kim@barrios-desktop> <20090526083538.GA29563@elf.ucw.cz> Date: Tue, 26 May 2009 18:40:35 +0900 Message-ID: <44c63dc40905260240n2c4e348ai74b7d42954098bf1@mail.gmail.com> Subject: Re: [PATCH][mmtom] clean up once printk routine From: Minchan Kim To: Pavel Machek Cc: Minchan Kim , akpm@linux-foundation.org, Randy Dunlap , KOSAKI Motohiro , Christoph Lameter , linux-mm@kvack.org, Dave Hansen , "David S. Miller" , Dominik Brodowski , Ingo Molnar , lkml Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Pavel. On Tue, May 26, 2009 at 5:35 PM, Pavel Machek 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 >> CC: Dominik Brodowski >> CC: David S. Miller >> CC: Ingo Molnar >> --- >>  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