Skip to content

Commit 32cf666

Browse files
sjp38akpm00
authored andcommitted
mm/memory_hotplug: cleanup return value handing in do_migrate_range()
Return value mechanism of do_migrate_range() is not very simple, while no caller of the function checks the return value. Make the function return nothing to be more simple, and cleanup related unnecessary code. Link: https://lkml.kernel.org/r/[email protected] Suggested-by: David Hildenbrand <[email protected]> Acked-by: David Hildenbrand <[email protected]> Reviewed-by: Baolin Wang <[email protected]> Signed-off-by: SeongJae Park <[email protected]> Cc: Oscar Salvador <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 7a079ba commit 32cf666

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

mm/memory_hotplug.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,12 +1620,10 @@ static int scan_movable_pages(unsigned long start, unsigned long end,
16201620
return 0;
16211621
}
16221622

1623-
static int
1624-
do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
1623+
static void do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
16251624
{
16261625
unsigned long pfn;
16271626
struct page *page, *head;
1628-
int ret = 0;
16291627
LIST_HEAD(source);
16301628
static DEFINE_RATELIMIT_STATE(migrate_rs, DEFAULT_RATELIMIT_INTERVAL,
16311629
DEFAULT_RATELIMIT_BURST);
@@ -1679,7 +1677,6 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
16791677
page_is_file_lru(page));
16801678

16811679
} else {
1682-
ret = -EBUSY;
16831680
if (__ratelimit(&migrate_rs)) {
16841681
pr_warn("failed to isolate pfn %lx\n", pfn);
16851682
dump_page(page, "isolation failed");
@@ -1693,6 +1690,7 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
16931690
.nmask = &nmask,
16941691
.gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL,
16951692
};
1693+
int ret;
16961694

16971695
/*
16981696
* We have checked that migration range is on a single zone so
@@ -1721,8 +1719,6 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
17211719
putback_movable_pages(&source);
17221720
}
17231721
}
1724-
1725-
return ret;
17261722
}
17271723

17281724
static int __init cmdline_parse_movable_node(char *p)

0 commit comments

Comments
 (0)