diff options
author | Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> | 2012-10-10 18:53:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-10 19:50:14 -0400 |
commit | 1633dbbacbaa3a2f95ef901caf9d0b32728c10b6 (patch) | |
tree | e501818f36de069851c5fa06bed08efb910608aa /arch/powerpc | |
parent | 158544b165d362c23acdde0104d9aab505a262a6 (diff) |
arch/powerpc/platforms/pseries/hotplug-memory.c: section removal cleanups
Followups to d760afd4d257 ("memory-hotplug: suppress "Trying to free
nonexistent resource <XXXXXXXXXXXXXXXX-YYYYYYYYYYYYYYYY>" warning").
- use unsigned long type, as overflows are conceivable
- rename `i' to the less-misleading and more informative `section'
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/pseries/hotplug-memory.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index 2fe690fcaa1d..ecdb0a6b3171 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c | |||
@@ -77,8 +77,9 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz | |||
77 | { | 77 | { |
78 | unsigned long start, start_pfn; | 78 | unsigned long start, start_pfn; |
79 | struct zone *zone; | 79 | struct zone *zone; |
80 | int i, ret; | 80 | int ret; |
81 | int sections_to_remove; | 81 | unsigned long section; |
82 | unsigned long sections_to_remove; | ||
82 | 83 | ||
83 | start_pfn = base >> PAGE_SHIFT; | 84 | start_pfn = base >> PAGE_SHIFT; |
84 | 85 | ||
@@ -99,8 +100,8 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz | |||
99 | * while writing to it. So we have to defer it to here. | 100 | * while writing to it. So we have to defer it to here. |
100 | */ | 101 | */ |
101 | sections_to_remove = (memblock_size >> PAGE_SHIFT) / PAGES_PER_SECTION; | 102 | sections_to_remove = (memblock_size >> PAGE_SHIFT) / PAGES_PER_SECTION; |
102 | for (i = 0; i < sections_to_remove; i++) { | 103 | for (section = 0; section < sections_to_remove; section++) { |
103 | unsigned long pfn = start_pfn + i * PAGES_PER_SECTION; | 104 | unsigned long pfn = start_pfn + section * PAGES_PER_SECTION; |
104 | ret = __remove_pages(zone, pfn, PAGES_PER_SECTION); | 105 | ret = __remove_pages(zone, pfn, PAGES_PER_SECTION); |
105 | if (ret) | 106 | if (ret) |
106 | return ret; | 107 | return ret; |