Skip to contentSkip to conversation

mm/acpi: use NUMA_NO_NODE

PATCH In review Jianguo Wu 3 participants 3 messages Aug 30, 2013

Subsystems (2)
lore
Share & tools
lore

Jianguo Wu

author
#0 lore raw

PATCH 2/4 mm/acpi: use NUMA_NO_NODE

Use more appropriate NUMA_NO_NODE instead of -1

---
 drivers/acpi/acpi_memhotplug.c |    2 +-
 drivers/acpi/numa.c            |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/acpi/acpi_memhotplug.c +1 -1
index 999adb5..c00a3a7 100644
@@ -281,7 +281,7 @@ static void acpi_memory_remove_memory(struct acpi_memory_device *mem_device)
 		if (!info->enabled)
 			continue;
 
-		if (nid < 0)
+		if (nid == NUMA_NO_NODE)
 			nid = memory_add_physaddr_to_nid(info->start_addr);
 
 		acpi_unbind_memory_blocks(info, handle);
drivers/acpi/numa.c +2 -2
index 33e609f..09f79a2 100644
@@ -73,7 +73,7 @@ int acpi_map_pxm_to_node(int pxm)
 {
 	int node = pxm_to_node_map[pxm];
 
-	if (node < 0) {
+	if (node == NUMA_NO_NODE) {
 		if (nodes_weight(nodes_found_map) >= MAX_NUMNODES)
 			return NUMA_NO_NODE;
 		node = first_unset_node(nodes_found_map);
@@ -334,7 +334,7 @@ int acpi_get_pxm(acpi_handle h)
 
 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)
Signature · 1 line
1.7.1
#1 lore raw
Quoted 3 lines · Jianguo Wu

Use more appropriate NUMA_NO_NODE instead of -1

I'll queue this up for 3.13.

Thanks,
Rafael

Quoted 41 lines
---
 drivers/acpi/acpi_memhotplug.c |    2 +-
 drivers/acpi/numa.c            |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/acpi/acpi_memhotplug.c +1 -1
index 999adb5..c00a3a7 100644
@@ -281,7 +281,7 @@ static void acpi_memory_remove_memory(struct acpi_memory_device *mem_device)
 		if (!info->enabled)
 			continue;
 
-		if (nid < 0)
+		if (nid == NUMA_NO_NODE)
 			nid = memory_add_physaddr_to_nid(info->start_addr);
 
 		acpi_unbind_memory_blocks(info, handle);
drivers/acpi/numa.c +2 -2
index 33e609f..09f79a2 100644
@@ -73,7 +73,7 @@ int acpi_map_pxm_to_node(int pxm)
 {
 	int node = pxm_to_node_map[pxm];
 
-	if (node < 0) {
+	if (node == NUMA_NO_NODE) {
 		if (nodes_weight(nodes_found_map) >= MAX_NUMNODES)
 			return NUMA_NO_NODE;
 		node = first_unset_node(nodes_found_map);
@@ -334,7 +334,7 @@ int acpi_get_pxm(acpi_handle h)
 
 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)
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.