mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: dave@gnu.org
Cc: Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86: cpu: use printk_once
Date: Sat, 16 Jun 2012 14:07:45 -0700	[thread overview]
Message-ID: <1339880865.23975.2.camel@joe2Laptop> (raw)
In-Reply-To: <1339875916.3269.4.camel@offbook>

On Sat, 2012-06-16 at 21:45 +0200, Davidlohr Bueso wrote:
> Use printk_once() instead of extra variables.

This is _very_ slightly larger.
The only thing I'd change is to use true instead of 1;
Well, I might use pr_info too...

> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
[]
> @@ -457,7 +457,6 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
>  #ifdef CONFIG_X86_HT
>  	u32 eax, ebx, ecx, edx;
>  	int index_msb, core_bits;
> -	static bool printed;
>  
>  	if (!cpu_has(c, X86_FEATURE_HT))
>  		return;
> @@ -493,12 +492,11 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
>  				       ((1 << core_bits) - 1);
>  
>  out:
> -	if (!printed && (c->x86_max_cores * smp_num_siblings) > 1) {
> -		printk(KERN_INFO  "CPU: Physical Processor ID: %d\n",
> -		       c->phys_proc_id);
> -		printk(KERN_INFO  "CPU: Processor Core ID: %d\n",
> -		       c->cpu_core_id);
> -		printed = 1;
> +	if ((c->x86_max_cores * smp_num_siblings) > 1) {
> +		printk_once(KERN_INFO  "CPU: Physical Processor ID: %d\n",
> +			    c->phys_proc_id);
> +		printk_once(KERN_INFO  "CPU: Processor Core ID: %d\n",
> +			    c->cpu_core_id);
>  	}
>  #endif
>  }
> diff --git a/arch/x86/kernel/cpu/topology.c b/arch/x86/kernel/cpu/topology.c
> index 4397e98..2f01ae0 100644
> --- a/arch/x86/kernel/cpu/topology.c
> +++ b/arch/x86/kernel/cpu/topology.c
> @@ -32,7 +32,6 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)
>  	unsigned int eax, ebx, ecx, edx, sub_index;
>  	unsigned int ht_mask_width, core_plus_mask_width;
>  	unsigned int core_select_mask, core_level_siblings;
> -	static bool printed;
>  
>  	if (c->cpuid_level < 0xb)
>  		return;
> @@ -86,14 +85,9 @@ void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c)
>  
>  	c->x86_max_cores = (core_level_siblings / smp_num_siblings);
>  
> -	if (!printed) {
> -		printk(KERN_INFO  "CPU: Physical Processor ID: %d\n",
> -		       c->phys_proc_id);
> -		if (c->x86_max_cores > 1)
> -			printk(KERN_INFO  "CPU: Processor Core ID: %d\n",
> -			       c->cpu_core_id);
> -		printed = 1;
> -	}
> +	printk_once(KERN_INFO  "CPU: Physical Processor ID: %d\n", c->phys_proc_id);
> +	if (c->x86_max_cores > 1)
> +		printk_once(KERN_INFO  "CPU: Processor Core ID: %d\n", c->cpu_core_id);
>  	return;
>  #endif
>  }




      reply	other threads:[~2012-06-16 21:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-16 19:45 Davidlohr Bueso
2012-06-16 21:07 ` Joe Perches [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=1339880865.23975.2.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=dave@gnu.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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

Powered by JetHome