aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-07-18 11:04:16 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-07-24 16:47:56 -0400
commit861a6ee8142efbe80b3891fdfb09f74d726c9809 (patch)
tree59620021e8e0069a0a6df2b2d2ce4b123d14d6f3
parent520eccdfe187591a51ea9ab4c1a024ae4d0f68d9 (diff)
ACPI / boot: Don't define unused variables
Some code in acpi_parse_x2apic() conditionally compiled, though parts of it are being used in any case. This annoys gcc. arch/x86/kernel/acpi/boot.c: In function ‘acpi_parse_x2apic’: arch/x86/kernel/acpi/boot.c:203:5: warning: variable ‘enabled’ set but not used [-Wunused-but-set-variable] u8 enabled; ^~~~~~~ arch/x86/kernel/acpi/boot.c:202:6: warning: variable ‘apic_id’ set but not used [-Wunused-but-set-variable] int apic_id; ^~~~~~~ Re-arrange the code to avoid compiling unused variables. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--arch/x86/kernel/acpi/boot.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 7491e73d9253..27f0240773b3 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -199,8 +199,10 @@ static int __init
199acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end) 199acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end)
200{ 200{
201 struct acpi_madt_local_x2apic *processor = NULL; 201 struct acpi_madt_local_x2apic *processor = NULL;
202#ifdef CONFIG_X86_X2APIC
202 int apic_id; 203 int apic_id;
203 u8 enabled; 204 u8 enabled;
205#endif
204 206
205 processor = (struct acpi_madt_local_x2apic *)header; 207 processor = (struct acpi_madt_local_x2apic *)header;
206 208
@@ -209,9 +211,10 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end)
209 211
210 acpi_table_print_madt_entry(header); 212 acpi_table_print_madt_entry(header);
211 213
214#ifdef CONFIG_X86_X2APIC
212 apic_id = processor->local_apic_id; 215 apic_id = processor->local_apic_id;
213 enabled = processor->lapic_flags & ACPI_MADT_ENABLED; 216 enabled = processor->lapic_flags & ACPI_MADT_ENABLED;
214#ifdef CONFIG_X86_X2APIC 217
215 /* 218 /*
216 * We need to register disabled CPU as well to permit 219 * We need to register disabled CPU as well to permit
217 * counting disabled CPUs. This allows us to size 220 * counting disabled CPUs. This allows us to size