x86/srat: fix the end pfn check in valid_numa_range()

... and fix the coding style on fly.

valid_numa_range(..., epfn << PAGE_SHIFT, ...) and its only caller
memory_add(..., epfn, pxm) interpret epfn inconsistently. The former
interprets epfn as the last pfn, while the latter interprets it as the
last pfn plus one. Fix this inconsistency in valid_numa_range(), since
most of other places use the latter interpretation.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Haozhong Zhang authored and Andrew Cooper committed 2018-02-12 11:08:33 +00:00
1 parent b2fd2ec8e1
commit 7226486767
1 file changed
+2 -2
+2 -2
View File
@@ -110,8 +110,8 @@ int valid_numa_range(u64 start, u64 end, nodeid_t node)
for (i = 0; i < num_node_memblks; i++) {
struct node *nd = &node_memblk_range[i];
if (nd->start <= start && nd->end > end &&
memblk_nodeid[i] == node )
if (nd->start <= start && nd->end >= end &&
memblk_nodeid[i] == node)
return 1;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.