[patch] acpi: acpi_numa_init() build fix

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ingo Molnar
Date: Wednesday, April 30, 2008 - 1:56 pm

* Len Brown <lenb@kernel.org> wrote:


something in this batch broke the build on x86 on current -git. Somewhat 
band-aid-ish fix below.

	Ingo

------------->
Subject: acpi: acpi_numa_init() build fix
From: Ingo Molnar <mingo@elte.hu>
Date: Tue Apr 29 00:40:16 CEST 2008

x86.git testing found the following build error on latest -git:

 drivers/acpi/numa.c: In function 'acpi_numa_init':
 drivers/acpi/numa.c:226: error: 'NR_NODE_MEMBLKS' undeclared (first use in this function)
 drivers/acpi/numa.c:226: error: (Each undeclared identifier is reported only once
 drivers/acpi/numa.c:226: error: for each function it appears in.)

with this config:

 http://redhat.com/~mingo/misc/config-Wed_Apr_30_22_42_42_CEST_2008.bad

i suspect we dont want SRAT parsing when CONFIG_HAVE_ARCH_PARSE_SRAT
is unset - but the fix looks a bit ugly. Perhaps we should define
NR_NODE_MEMBLKS even in this case and just let the code fall back
to some sane behavior?

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 drivers/acpi/numa.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: linux/drivers/acpi/numa.c
===================================================================
--- linux.orig/drivers/acpi/numa.c
+++ linux/drivers/acpi/numa.c
@@ -176,6 +176,7 @@ acpi_parse_processor_affinity(struct acp
 	return 0;
 }
 
+#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT
 static int __init
 acpi_parse_memory_affinity(struct acpi_subtable_header * header,
 			   const unsigned long end)
@@ -193,6 +194,7 @@ acpi_parse_memory_affinity(struct acpi_s
 
 	return 0;
 }
+#endif
 
 static int __init acpi_parse_srat(struct acpi_table_header *table)
 {
@@ -221,9 +223,11 @@ int __init acpi_numa_init(void)
 	if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) {
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY,
 				      acpi_parse_processor_affinity, NR_CPUS);
+#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT
 		acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY,
 				      acpi_parse_memory_affinity,
 				      NR_NODE_MEMBLKS);
+#endif
 	}
 
 	/* SLIT: System Locality Information Table */
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PATCH] ACPI patches for 2.6.26-rc0, Len Brown, (Wed Apr 30, 11:20 am)
Re: [GIT PATCH] ACPI patches for 2.6.26-rc0, Andrew Morton, (Wed Apr 30, 11:43 am)
Re: [GIT PATCH] ACPI patches for 2.6.26-rc0, Linus Torvalds, (Wed Apr 30, 11:55 am)
Re: [GIT PATCH] ACPI patches for 2.6.26-rc0, Rafael J. Wysocki, (Wed Apr 30, 12:00 pm)
[patch] acpi: acpi_numa_init() build fix, Ingo Molnar, (Wed Apr 30, 1:56 pm)
[patch] acpi: fix drivers/acpi/glue.c build error, Ingo Molnar, (Wed Apr 30, 2:00 pm)
Re: [GIT PATCH] ACPI patches for 2.6.26-rc0, Stephen Rothwell, (Wed Apr 30, 5:26 pm)
Re: [GIT PATCH] ACPI patches for 2.6.26-rc0, Len Brown, (Wed Apr 30, 11:39 pm)
Re: [GIT PATCH] ACPI patches for 2.6.26-rc0, Adrian Bunk, (Thu May 1, 5:16 am)