aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory_hotplug.c
diff options
context:
space:
mode:
authorXishi Qiu <qiuxishi@huawei.com>2013-09-11 17:21:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 18:57:35 -0400
commit37b000b640741132eddaa9fbeca1f988139ad7e2 (patch)
tree8456554ec797adf9c03c56173c48c2082bcdb40e /mm/memory_hotplug.c
parentb136be5e0b6e8e3e4dcb6722b51bb35199b06810 (diff)
mm/hotplug: remove unnecessary BUG_ON in __offline_pages()
I think we can remove "BUG_ON(start_pfn >= end_pfn)" in __offline_pages(), because in memory_block_action() "nr_pages = PAGES_PER_SECTION * sections_per_block" is always greater than 0. memory_block_action() offline_pages() __offline_pages() BUG_ON(start_pfn >= end_pfn) In v2.6.32, If info->length==0, this way may hit this BUG_ON(). acpi_memory_disable_device() remove_memory(info->start_addr, info->length) offline_pages() A later Fujitsu patch renamed this function and the BUG_ON() is unnecessary. Signed-off-by: Xishi Qiu <qiuxishi@huawei.com> Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com> Cc: Toshi Kani <toshi.kani@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory_hotplug.c')
-rw-r--r--mm/memory_hotplug.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index ca1dd3aa5eee..8e333f953f08 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1472,7 +1472,6 @@ static int __ref __offline_pages(unsigned long start_pfn,
1472 struct zone *zone; 1472 struct zone *zone;
1473 struct memory_notify arg; 1473 struct memory_notify arg;
1474 1474
1475 BUG_ON(start_pfn >= end_pfn);
1476 /* at least, alignment against pageblock is necessary */ 1475 /* at least, alignment against pageblock is necessary */
1477 if (!IS_ALIGNED(start_pfn, pageblock_nr_pages)) 1476 if (!IS_ALIGNED(start_pfn, pageblock_nr_pages))
1478 return -EINVAL; 1477 return -EINVAL;