diff mbox

[2/4] mm/acpi: use NUMA_NO_NODE

Message ID 521FF494.6000504@huawei.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Jianguo Wu Aug. 30, 2013, 1:25 a.m. UTC
Use more appropriate NUMA_NO_NODE instead of -1

Signed-off-by: Jianguo Wu <wujianguo@huawei.com>
---
 drivers/acpi/acpi_memhotplug.c |    2 +-
 drivers/acpi/numa.c            |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Rafael Wysocki Aug. 30, 2013, 12:07 p.m. UTC | #1
On Friday, August 30, 2013 09:25:40 AM Jianguo Wu wrote:
> Use more appropriate NUMA_NO_NODE instead of -1
> 
> Signed-off-by: Jianguo Wu <wujianguo@huawei.com>

I'll queue this up for 3.13.

Thanks,
Rafael


> ---
>  drivers/acpi/acpi_memhotplug.c |    2 +-
>  drivers/acpi/numa.c            |    4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
> index 999adb5..c00a3a7 100644
> --- a/drivers/acpi/acpi_memhotplug.c
> +++ b/drivers/acpi/acpi_memhotplug.c
> @@ -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);
> diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
> index 33e609f..09f79a2 100644
> --- a/drivers/acpi/numa.c
> +++ b/drivers/acpi/numa.c
> @@ -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)
>
David Rientjes Aug. 30, 2013, 9:48 p.m. UTC | #2
On Fri, 30 Aug 2013, Jianguo Wu wrote:

> Use more appropriate NUMA_NO_NODE instead of -1
> 
> Signed-off-by: Jianguo Wu <wujianguo@huawei.com>

Acked-by: David Rientjes <rientjes@google.com>
--
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
diff mbox

Patch

diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 999adb5..c00a3a7 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -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);
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index 33e609f..09f79a2 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -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)