提交 1633dbba 编写于 作者: Y Yasuaki Ishimatsu 提交者: Linus Torvalds

arch/powerpc/platforms/pseries/hotplug-memory.c: section removal cleanups

Followups to d760afd4 ("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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 158544b1
...@@ -77,8 +77,9 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz ...@@ -77,8 +77,9 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz
{ {
unsigned long start, start_pfn; unsigned long start, start_pfn;
struct zone *zone; struct zone *zone;
int i, ret; int ret;
int sections_to_remove; unsigned long section;
unsigned long sections_to_remove;
start_pfn = base >> PAGE_SHIFT; start_pfn = base >> PAGE_SHIFT;
...@@ -99,8 +100,8 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz ...@@ -99,8 +100,8 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz
* while writing to it. So we have to defer it to here. * while writing to it. So we have to defer it to here.
*/ */
sections_to_remove = (memblock_size >> PAGE_SHIFT) / PAGES_PER_SECTION; sections_to_remove = (memblock_size >> PAGE_SHIFT) / PAGES_PER_SECTION;
for (i = 0; i < sections_to_remove; i++) { for (section = 0; section < sections_to_remove; section++) {
unsigned long pfn = start_pfn + i * PAGES_PER_SECTION; unsigned long pfn = start_pfn + section * PAGES_PER_SECTION;
ret = __remove_pages(zone, pfn, PAGES_PER_SECTION); ret = __remove_pages(zone, pfn, PAGES_PER_SECTION);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册