[PATCH 2/3] page_to_pfn(): use ULONGLONG_MAX to for invalid pfn

Mika Westerberg ext-mika.1.westerberg at nokia.com
Tue Jun 22 02:59:11 EDT 2010


Some architectures define PHYS_PFN_OFFSET to be != 0 (ARM for example). This
means that mem_map[0] is actually first page in kernel direct mapped view (which
is a valid page).

Change invalid pfn to be ULONGLONG_MAX instead of 0 to handle such cases.

Signed-off-by: Mika Westerberg <ext-mika.1.westerberg at nokia.com>
---
 makedumpfile.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/makedumpfile.c b/makedumpfile.c
index a33bab6..89360bd 100644
--- a/makedumpfile.c
+++ b/makedumpfile.c
@@ -4383,7 +4383,8 @@ unsigned long long
 page_to_pfn(unsigned long page)
 {
 	unsigned int num;
-	unsigned long long pfn = 0, index = 0;
+	unsigned long long pfn = ULONGLONG_MAX;
+	unsigned long long index = 0;
 	struct mem_map_data *mmd;
 
 	mmd = info->mem_map_data;
@@ -4398,7 +4399,7 @@ page_to_pfn(unsigned long page)
 		pfn = mmd->pfn_start + index;
 		break;
 	}
-	if (!pfn) {
+	if (pfn == ULONGLONG_MAX) {
 		ERRMSG("Can't convert the address of page descriptor (%lx) to pfn.\n", page);
 		return ULONGLONG_MAX;
 	}
-- 
1.5.6.5




More information about the linux-arm-kernel mailing list