diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-03 12:11:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-03 12:11:02 -0500 |
commit | 2a32f2db132264c356aea30a8270d3e68d96c509 (patch) | |
tree | f98f0e1b9d85c7964b8fc149f451ae77072c3c27 /kernel/resource.c | |
parent | feaf77d51a6e2e95f60c8095ac7282e610ede798 (diff) | |
parent | f41496607e03ab99f263b8e26689ad0fc853007f (diff) |
Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
resource: Fix broken indentation
resource: Fix generic page_is_ram() for partial RAM pages
x86, paravirt: Remove kmap_atomic_pte paravirt op.
x86, vmi: Disable highmem PTE allocation even when CONFIG_HIGHPTE=y
x86, xen: Disable highmem PTE allocation even when CONFIG_HIGHPTE=y
Diffstat (limited to 'kernel/resource.c')
-rw-r--r-- | kernel/resource.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/resource.c b/kernel/resource.c index 4e9d87fd7bc5..2d5be5d9bf5f 100644 --- a/kernel/resource.c +++ b/kernel/resource.c | |||
@@ -304,7 +304,7 @@ int walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages, | |||
304 | void *arg, int (*func)(unsigned long, unsigned long, void *)) | 304 | void *arg, int (*func)(unsigned long, unsigned long, void *)) |
305 | { | 305 | { |
306 | struct resource res; | 306 | struct resource res; |
307 | unsigned long pfn, len; | 307 | unsigned long pfn, end_pfn; |
308 | u64 orig_end; | 308 | u64 orig_end; |
309 | int ret = -1; | 309 | int ret = -1; |
310 | 310 | ||
@@ -314,9 +314,10 @@ int walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages, | |||
314 | orig_end = res.end; | 314 | orig_end = res.end; |
315 | while ((res.start < res.end) && | 315 | while ((res.start < res.end) && |
316 | (find_next_system_ram(&res, "System RAM") >= 0)) { | 316 | (find_next_system_ram(&res, "System RAM") >= 0)) { |
317 | pfn = (unsigned long)(res.start >> PAGE_SHIFT); | 317 | pfn = (res.start + PAGE_SIZE - 1) >> PAGE_SHIFT; |
318 | len = (unsigned long)((res.end + 1 - res.start) >> PAGE_SHIFT); | 318 | end_pfn = (res.end + 1) >> PAGE_SHIFT; |
319 | ret = (*func)(pfn, len, arg); | 319 | if (end_pfn > pfn) |
320 | ret = (*func)(pfn, end_pfn - pfn, arg); | ||
320 | if (ret) | 321 | if (ret) |
321 | break; | 322 | break; |
322 | res.start = res.end + 1; | 323 | res.start = res.end + 1; |