diff options
Diffstat (limited to 'include/asm-x86_64')
-rw-r--r-- | include/asm-x86_64/mmzone.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h index 8d48dc7e43a7..69baaa8a3ce0 100644 --- a/include/asm-x86_64/mmzone.h +++ b/include/asm-x86_64/mmzone.h | |||
@@ -17,16 +17,15 @@ | |||
17 | /* Simple perfect hash to map physical addresses to node numbers */ | 17 | /* Simple perfect hash to map physical addresses to node numbers */ |
18 | extern int memnode_shift; | 18 | extern int memnode_shift; |
19 | extern u8 memnodemap[NODEMAPSIZE]; | 19 | extern u8 memnodemap[NODEMAPSIZE]; |
20 | extern int maxnode; | ||
21 | 20 | ||
22 | extern struct pglist_data *node_data[]; | 21 | extern struct pglist_data *node_data[]; |
23 | 22 | ||
24 | static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) | 23 | static inline __attribute__((pure)) int phys_to_nid(unsigned long addr) |
25 | { | 24 | { |
26 | int nid; | 25 | unsigned nid; |
27 | VIRTUAL_BUG_ON((addr >> memnode_shift) >= NODEMAPSIZE); | 26 | VIRTUAL_BUG_ON((addr >> memnode_shift) >= NODEMAPSIZE); |
28 | nid = memnodemap[addr >> memnode_shift]; | 27 | nid = memnodemap[addr >> memnode_shift]; |
29 | VIRTUAL_BUG_ON(nid > maxnode); | 28 | VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]); |
30 | return nid; | 29 | return nid; |
31 | } | 30 | } |
32 | 31 | ||