Skip to contentSkip to conversation

x86: use the correct macros

PATCH In review Yasuaki Ishimatsu 2 participants 2 messages Sep 26, 2012 – Sep 27, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: use the correct macros

This patch fixes to use the correct macros.

CC Len Brown <[email protected]>
CC Thomas Gleixner <[email protected]>
CC Ingo Molnar <[email protected]>
CC H. Peter Anvin <[email protected]>
---
 arch/x86/kernel/acpi/boot.c |    2 +-
 drivers/acpi/numa.c         |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/acpi/boot.c +1 -1
Index: linux-3.6-rc5/arch/x86/kernel/acpi/boot.c
===================================================================
@@ -601,7 +601,7 @@ static void __cpuinit acpi_map_cpu2node(
 	int nid;
 
 	nid = acpi_get_node(handle);
-	if (nid == -1 || !node_online(nid))
+	if (nid == NUMA_NO_NODE || !node_online(nid))
 		return;
 	set_apicid_to_node(physid, nid);
 	numa_set_node(cpu, nid);
drivers/acpi/numa.c +2 -2
Index: linux-3.6-rc5/drivers/acpi/numa.c
===================================================================
@@ -327,12 +327,12 @@ int acpi_get_pxm(acpi_handle h)
 			return pxm;
 		status = acpi_get_parent(handle, &phandle);
 	} while (ACPI_SUCCESS(status));
-	return -1;
+	return PXM_INVAL;
 }
 
 int acpi_get_node(acpi_handle *handle)
 {
-	int pxm, node = -1;
+	int pxm, node = NUMA_NO_NODE;
 
 	pxm = acpi_get_pxm(handle);
 	if (pxm >= 0 && pxm < MAX_PXM_DOMAINS)
#1 lore raw

At 09/26/2012 09:11 AM, Yasuaki Ishimatsu Wrote:

Quoted 1 line

This patch fixes to use the correct macros.

But you don't fix all. For example:
=================

	arg.start_pfn = pfn;
	arg.nr_pages = nr_pages;
	arg.status_change_nid = -1;     <====== here

	nid = page_to_nid(pfn_to_page(pfn));
	if (node_present_pages(nid) == 0)
		arg.status_change_nid = nid;

	ret = memory_notify(MEM_GOING_ONLINE, &arg);

==================

There is the same problem in the function offline_pages() too.

Thanks
Wen Congyang

Quoted 50 lines
CC Len Brown <[email protected]>
CC Thomas Gleixner <[email protected]>
CC Ingo Molnar <[email protected]>
CC H. Peter Anvin <[email protected]>
---
 arch/x86/kernel/acpi/boot.c |    2 +-
 drivers/acpi/numa.c         |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Index: linux-3.6-rc5/arch/x86/kernel/acpi/boot.c
===================================================================

arch/x86/kernel/acpi/boot.c +1 -1
@@ -601,7 +601,7 @@ static void __cpuinit acpi_map_cpu2node(
 	int nid;
 
 	nid = acpi_get_node(handle);
-	if (nid == -1 || !node_online(nid))
+	if (nid == NUMA_NO_NODE || !node_online(nid))
 		return;
 	set_apicid_to_node(physid, nid);
 	numa_set_node(cpu, nid);

Index: linux-3.6-rc5/drivers/acpi/numa.c
===================================================================

drivers/acpi/numa.c +2 -3
@@ -327,12 +327,12 @@ int acpi_get_pxm(acpi_handle h)
 			return pxm;
 		status = acpi_get_parent(handle, &phandle);
 	} while (ACPI_SUCCESS(status));
-	return -1;
+	return PXM_INVAL;
 }
 
 int acpi_get_node(acpi_handle *handle)
 {
-	int pxm, node = -1;
+	int pxm, node = NUMA_NO_NODE;
 
 	pxm = acpi_get_pxm(handle);
 	if (pxm >= 0 && pxm < MAX_PXM_DOMAINS)
 
--

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/