diff options
Diffstat (limited to 'kernel/resource.c')
-rw-r--r-- | kernel/resource.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/resource.c b/kernel/resource.c index 74877e9d90ca..76036a41143b 100644 --- a/kernel/resource.c +++ b/kernel/resource.c | |||
@@ -487,8 +487,8 @@ int walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages, | |||
487 | while (start < end && | 487 | while (start < end && |
488 | !find_next_iomem_res(start, end, flags, IORES_DESC_NONE, | 488 | !find_next_iomem_res(start, end, flags, IORES_DESC_NONE, |
489 | false, &res)) { | 489 | false, &res)) { |
490 | pfn = (res.start + PAGE_SIZE - 1) >> PAGE_SHIFT; | 490 | pfn = PFN_UP(res.start); |
491 | end_pfn = (res.end + 1) >> PAGE_SHIFT; | 491 | end_pfn = PFN_DOWN(res.end + 1); |
492 | if (end_pfn > pfn) | 492 | if (end_pfn > pfn) |
493 | ret = (*func)(pfn, end_pfn - pfn, arg); | 493 | ret = (*func)(pfn, end_pfn - pfn, arg); |
494 | if (ret) | 494 | if (ret) |