summaryrefslogtreecommitdiffstatshomepage
path: root/mm
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2019-07-18 14:57:37 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-18 16:08:06 -0800
commit2491f0a2c0b117b9097e9c9eee0c21f2e5f716d7 (patch)
treeb18a84bff04fe7a6d2d224fef78c7723d8d9e680 /mm
parent756398750e11ade1e617cd2a8f8d66fe7ed637e1 (diff)
downloadlinux-stable-2491f0a2c0b117b9097e9c9eee0c21f2e5f716d7.tar.gz
linux-stable-2491f0a2c0b117b9097e9c9eee0c21f2e5f716d7.tar.bz2
linux-stable-2491f0a2c0b117b9097e9c9eee0c21f2e5f716d7.tar.xz
linux-stable-2491f0a2c0b117b9097e9c9eee0c21f2e5f716d7.zip
mm: section numbers use the type "unsigned long"
Patch series "mm: Further memory block device cleanups", v1. Some further cleanups around memory block devices. Especially, clean up and simplify walk_memory_range(). Including some other minor cleanups. This patch (of 6): We are using a mixture of "int" and "unsigned long". Let's make this consistent by using "unsigned long" everywhere. We'll do the same with memory block ids next. While at it, turn the "unsigned long i" in removable_show() into an int - sections_per_block is an int. [akpm@linux-foundation.org: s/unsigned long i/unsigned long nr/] [david@redhat.com: v3] Link: http://lkml.kernel.org/r/20190620183139.4352-2-david@redhat.com Link: http://lkml.kernel.org/r/20190614100114.311-2-david@redhat.com Signed-off-by: David Hildenbrand <david@redhat.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: "Rafael J. Wysocki" <rafael@kernel.org> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Michal Hocko <mhocko@suse.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Mel Gorman <mgorman@techsingularity.net> Cc: Wei Yang <richard.weiyang@gmail.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Arun KS <arunks@codeaurora.org> Cc: Pavel Tatashin <pasha.tatashin@soleen.com> Cc: Oscar Salvador <osalvador@suse.de> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Mike Rapoport <rppt@linux.vnet.ibm.com> Cc: Baoquan He <bhe@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/sparse.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mm/sparse.c b/mm/sparse.c
index fe44b2d3bd7e..b29534cea8c0 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -102,7 +102,7 @@ static inline int sparse_index_init(unsigned long section_nr, int nid)
102#endif 102#endif
103 103
104#ifdef CONFIG_SPARSEMEM_EXTREME 104#ifdef CONFIG_SPARSEMEM_EXTREME
105int __section_nr(struct mem_section* ms) 105unsigned long __section_nr(struct mem_section *ms)
106{ 106{
107 unsigned long root_nr; 107 unsigned long root_nr;
108 struct mem_section *root = NULL; 108 struct mem_section *root = NULL;
@@ -121,9 +121,9 @@ int __section_nr(struct mem_section* ms)
121 return (root_nr * SECTIONS_PER_ROOT) + (ms - root); 121 return (root_nr * SECTIONS_PER_ROOT) + (ms - root);
122} 122}
123#else 123#else
124int __section_nr(struct mem_section* ms) 124unsigned long __section_nr(struct mem_section *ms)
125{ 125{
126 return (int)(ms - mem_section[0]); 126 return (unsigned long)(ms - mem_section[0]);
127} 127}
128#endif 128#endif
129 129
@@ -178,10 +178,10 @@ void __meminit mminit_validate_memmodel_limits(unsigned long *start_pfn,
178 * Keeping track of this gives us an easy way to break out of 178 * Keeping track of this gives us an easy way to break out of
179 * those loops early. 179 * those loops early.
180 */ 180 */
181int __highest_present_section_nr; 181unsigned long __highest_present_section_nr;
182static void section_mark_present(struct mem_section *ms) 182static void section_mark_present(struct mem_section *ms)
183{ 183{
184 int section_nr = __section_nr(ms); 184 unsigned long section_nr = __section_nr(ms);
185 185
186 if (section_nr > __highest_present_section_nr) 186 if (section_nr > __highest_present_section_nr)
187 __highest_present_section_nr = section_nr; 187 __highest_present_section_nr = section_nr;
@@ -189,7 +189,7 @@ static void section_mark_present(struct mem_section *ms)
189 ms->section_mem_map |= SECTION_MARKED_PRESENT; 189 ms->section_mem_map |= SECTION_MARKED_PRESENT;
190} 190}
191 191
192static inline int next_present_section_nr(int section_nr) 192static inline unsigned long next_present_section_nr(unsigned long section_nr)
193{ 193{
194 do { 194 do {
195 section_nr++; 195 section_nr++;