From: Adrian Bunk <bunk@kernel.org>
To: Jeff Garzik <jeff@garzik.org>,
lenb@kernel.org, mingo@redhat.com, hpa@zytor.com
Cc: LKML <linux-kernel@vger.kernel.org>,
akpm@linux-foundation.org, tglx@linutronix.de,
linux-acpi@vger.kernel.org
Subject: [2.6 patch] x86/kernel/acpi/processor.c: fix SMP=n warning
Date: Wed, 24 Oct 2007 18:27:13 +0200 [thread overview]
Message-ID: <20071024162713.GQ30533@stusta.de> (raw)
In-Reply-To: <tueoct232007613pm.likjasfdlkjdas987@havoc.gtf.org>
On Tue, Oct 23, 2007 at 06:36:33PM -0400, Jeff Garzik wrote:
> Fix !CONFIG_SMP warning:
>
> arch/x86/kernel/acpi/processor.c: In function ‘arch_acpi_processor_init_pdc’:
> arch/x86/kernel/acpi/processor.c:65: warning: unused variable ‘cpu’
>
> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
> ---
> Ideally this warning should be hidden inside a wrapper or somesuch, to
> camouflage the unneeded argument in !SMP case.
>
> diff --git a/arch/x86/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c
> index 2ed0a4c..45e262a 100644
> --- a/arch/x86/kernel/acpi/processor.c
> +++ b/arch/x86/kernel/acpi/processor.c
> @@ -62,7 +62,9 @@ static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c)
> /* Initialize _PDC data based on the CPU vendor */
> void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
> {
> +#ifdef CONFIG_SMP
> unsigned int cpu = pr->id;
> +#endif
>...
The #ifdef is ugly.
What about the patch below instead?
cu
Adrian
<-- snip -->
This patch fixes the following warning with CONFIG_SMP=n:
<-- snip -->
...
arch/x86/kernel/acpi/processor.c: In function `arch_acpi_processor_init_pdc':
arch/x86/kernel/acpi/processor.c:65: warning: unused variable `cpu'
...
<-- snip -->
Based on a patch by Jeff Garzik.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
---
96d83d412fb6530173110c872f1125ae21938a99
diff --git a/arch/x86/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c
index 2ed0a4c..f63e5ff 100644
--- a/arch/x86/kernel/acpi/processor.c
+++ b/arch/x86/kernel/acpi/processor.c
@@ -62,8 +62,7 @@ static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c)
/* Initialize _PDC data based on the CPU vendor */
void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
{
- unsigned int cpu = pr->id;
- struct cpuinfo_x86 *c = &cpu_data(cpu);
+ struct cpuinfo_x86 *c = &cpu_data(pr->id);
pr->pdc = NULL;
if (c->x86_vendor == X86_VENDOR_INTEL)
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
parent reply other threads:[~2007-10-24 16:26 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <tueoct232007613pm.likjasfdlkjdas987@havoc.gtf.org>]
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=20071024162713.GQ30533@stusta.de \
--to=bunk@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=jeff@garzik.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--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