public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jack Steiner <steiner@sgi.com>
To: Andreas Herrmann <andreas.herrmann3@amd.com>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: fix compile warning in io_apic_{32,64}.c
Date: Thu, 5 Jun 2008 07:39:10 -0500	[thread overview]
Message-ID: <20080605123910.GA5938@sgi.com> (raw)
In-Reply-To: <20080605120557.GB14755@alberich.amd.com>

On Thu, Jun 05, 2008 at 02:05:57PM +0200, Andreas Herrmann wrote:
> Commit 05f2d12c3563dea8c81b301f9f3cf7919af23b13
> (x86: change GET_APIC_ID() from an inline function to an out-of-line function)
> 
> introduced a compile warning
> 
> arch/x86/kernel/io_apic_64.c: In function 'print_local_APIC':
> arch/x86/kernel/io_apic_64.c:1152: warning: 'v' is used uninitialized in this function
> 
> in some debug code -- which is not enabled by default.
> This patch reverts the code changes in print_local_APIC.
> 
> Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
> 
> --
> diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
> index a40d54f..9a3446f 100644
> --- a/arch/x86/kernel/io_apic_32.c
> +++ b/arch/x86/kernel/io_apic_32.c
> @@ -1489,8 +1489,8 @@ void /*__init*/ print_local_APIC(void * dummy)
>  
>  	printk("\n" KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n",
>  		smp_processor_id(), hard_smp_processor_id());
> -	printk(KERN_INFO "... APIC ID:      %08x (%01x)\n", v,
> -			GET_APIC_ID(read_apic_id()));
> +	v = apic_read(APIC_ID);
> +	printk(KERN_INFO "... APIC ID:      %08x (%01x)\n", v, GET_APIC_ID(v));
>  	v = apic_read(APIC_LVR);
>  	printk(KERN_INFO "... APIC VERSION: %08x\n", v);
>  	ver = GET_APIC_VERSION(v);
> diff --git a/arch/x86/kernel/io_apic_64.c b/arch/x86/kernel/io_apic_64.c
> index ef1a8df..59ed52c 100644
> --- a/arch/x86/kernel/io_apic_64.c
> +++ b/arch/x86/kernel/io_apic_64.c
> @@ -1077,7 +1077,8 @@ void __apicdebuginit print_local_APIC(void * dummy)
>  
>  	printk("\n" KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n",
>  		smp_processor_id(), hard_smp_processor_id());
> -	printk(KERN_INFO "... APIC ID:      %08x (%01x)\n", v, GET_APIC_ID(read_apic_id()));
> +	v = apic_read(APIC_ID);

I don't think this work on UV systems. Because of processor limitations, not
all of the APICID bits are contained in the hardware APIC_ID register. See
read_apic_id() in arch/x86/kernel/genapic_64.c.

I have not seen the compiler warning. What tree/options cause the error???


> +	printk(KERN_INFO "... APIC ID:      %08x (%01x)\n", v, GET_APIC_ID(v));
>  	v = apic_read(APIC_LVR);
>  	printk(KERN_INFO "... APIC VERSION: %08x\n", v);
>  	ver = GET_APIC_VERSION(v);
> 
> 
> 

--- jack

  reply	other threads:[~2008-06-05 12:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-05 12:05 [PATCH] x86: fix compile warning in io_apic_{32,64}.c Andreas Herrmann
2008-06-05 12:39 ` Jack Steiner [this message]
2008-06-05 14:35   ` Andreas Herrmann
2008-06-10 10:21 ` Ingo Molnar

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=20080605123910.GA5938@sgi.com \
    --to=steiner@sgi.com \
    --cc=andreas.herrmann3@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.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