Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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 <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Randy Dunlap and committed by
Linus Torvalds
f05b6284 5a88a13d

+1 -1
+1 -1
include/asm-generic/memory_model.h
··· 54 54 #define __page_to_pfn(pg) \ 55 55 ({ struct page *__pg = (pg); \ 56 56 int __sec = page_to_section(__pg); \ 57 - __pg - __section_mem_map_addr(__nr_to_section(__sec)); \ 57 + (unsigned long)(__pg - __section_mem_map_addr(__nr_to_section(__sec))); \ 58 58 }) 59 59 60 60 #define __pfn_to_page(pfn) \