lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 26 May 2009 10:35:38 +0200
From:	Pavel Machek <pavel@....cz>
To:	Minchan Kim <minchan.kim@...il.com>
Cc:	akpm@...ux-foundation.org, Randy Dunlap <randy.dunlap@...cle.com>,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	Christoph Lameter <cl@...ux-foundation.org>,
	linux-mm@...ck.org, Dave Hansen <dave@...ux.vnet.ibm.com>,
	"David S. Miller" <davem@...emloft.net>,
	Dominik Brodowski <linux@...inikbrodowski.net>,
	Ingo Molnar <mingo@...e.hu>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH][mmtom] clean up once printk routine

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@...il.com>
> CC: Dominik Brodowski <linux@...inikbrodowski.net>
> CC: David S. Miller <davem@...emloft.net>
> CC: Ingo Molnar <mingo@...e.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?

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

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ