From e4e94072d9c3b19662537cbd5e2d37bcaeed3d9b Mon Sep 17 00:00:00 2001
From: Andi Kleen <ak@suse.de>
Date: Wed, 11 Jan 2006 22:43:48 +0100
Subject: [PATCH] x86_64: Return -1 for unknown PCI bus affinity

When we don't know the node a PCI bus is connected to return -1.
This matches the generic code.

Noticed by Ravikiran G Thirumalai <kiran@scalex86.org>

Cc: Ravikiran G Thirumalai <kiran@scalex86.org>

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---
 arch/x86_64/mm/srat.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'arch/x86_64/mm/srat.c')

diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c
index 9f69d28652f8..d96c701dbed6 100644
--- a/arch/x86_64/mm/srat.c
+++ b/arch/x86_64/mm/srat.c
@@ -23,15 +23,16 @@ static struct acpi_table_slit *acpi_slit;
 static nodemask_t nodes_parsed __initdata;
 static nodemask_t nodes_found __initdata;
 static struct node nodes[MAX_NUMNODES] __initdata;
-static __u8  pxm2node[256] = { [0 ... 255] = 0xff };
+static u8 pxm2node[256] = { [0 ... 255] = 0xff };
 
 static int node_to_pxm(int n);
 
 int pxm_to_node(int pxm)
 {
 	if ((unsigned)pxm >= 256)
-		return 0;
-	return pxm2node[pxm];
+		return -1;
+	/* Extend 0xff to (int)-1 */
+	return (signed char)pxm2node[pxm];
 }
 
 static __init int setup_node(int pxm)
-- 
cgit v1.2.3