From: Randy Dunlap Date: Sat, 10 Feb 2007 09:42:59 +0000 (-0800) Subject: [PATCH] typeof __page_to_pfn with SPARSEMEM=y X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f05b6284ee5d3be51ebe22284fc4b25fc586f380;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [PATCH] typeof __page_to_pfn with SPARSEMEM=y With CONFIG_SPARSEMEM=y: mm/rmap.c:579: warning: format '%lx' expects type 'long unsigned int', but argument 2 has type 'int' Make __page_to_pfn() return unsigned long. Signed-off-by: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h index 8078cbd2c016..30d8d33491dd 100644 --- a/include/asm-generic/memory_model.h +++ b/include/asm-generic/memory_model.h @@ -54,7 +54,7 @@ #define __page_to_pfn(pg) \ ({ struct page *__pg = (pg); \ int __sec = page_to_section(__pg); \ - __pg - __section_mem_map_addr(__nr_to_section(__sec)); \ + (unsigned long)(__pg - __section_mem_map_addr(__nr_to_section(__sec))); \ }) #define __pfn_to_page(pfn) \