From 9a845030427c7a2879a7d635cc7c0e5f79ec962d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 18 Jul 2019 15:58:43 -0700 Subject: mm/sparsemem: cleanup 'section number' data types David points out that there is a mixture of 'int' and 'unsigned long' usage for section number data types. Update the memory hotplug path to use 'unsigned long' consistently for section numbers. [akpm@linux-foundation.org: fix printk format] Link: http://lkml.kernel.org/r/156107543656.1329419.11505835211949439815.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams Reported-by: David Hildenbrand Reviewed-by: David Hildenbrand Cc: Michal Hocko Cc: Oscar Salvador Cc: Jason Gunthorpe Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/sparse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mm/sparse.c') diff --git a/mm/sparse.c b/mm/sparse.c index a205a2ac66a4..72f010d9bff5 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -229,21 +229,21 @@ void subsection_mask_set(unsigned long *map, unsigned long pfn, void __init subsection_map_init(unsigned long pfn, unsigned long nr_pages) { int end_sec = pfn_to_section_nr(pfn + nr_pages - 1); - int i, start_sec = pfn_to_section_nr(pfn); + unsigned long nr, start_sec = pfn_to_section_nr(pfn); if (!nr_pages) return; - for (i = start_sec; i <= end_sec; i++) { + for (nr = start_sec; nr <= end_sec; nr++) { struct mem_section *ms; unsigned long pfns; pfns = min(nr_pages, PAGES_PER_SECTION - (pfn & ~PAGE_SECTION_MASK)); - ms = __nr_to_section(i); + ms = __nr_to_section(nr); subsection_mask_set(ms->usage->subsection_map, pfn, pfns); - pr_debug("%s: sec: %d pfns: %ld set(%d, %d)\n", __func__, i, + pr_debug("%s: sec: %lu pfns: %lu set(%d, %d)\n", __func__, nr, pfns, subsection_map_index(pfn), subsection_map_index(pfn + pfns - 1)); -- cgit