Skip to content

Commit

Permalink
memory hotplug: use macro to switch between section and pfn
Browse files Browse the repository at this point in the history
Use macro section_nr_to_pfn() to switch between section and pfn, instead
of open-coding it.  No semantic changes.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Sheng Yong authored and torvalds committed Apr 14, 2015
1 parent 1575e68 commit 19c07d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/base/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ memory_block_action(unsigned long phys_index, unsigned long action, int online_t
struct page *first_page;
int ret;

start_pfn = phys_index << PFN_SECTION_SHIFT;
start_pfn = section_nr_to_pfn(phys_index);
first_page = pfn_to_page(start_pfn);

switch (action) {
Expand Down
2 changes: 1 addition & 1 deletion mm/memory_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ int __ref __add_pages(int nid, struct zone *zone, unsigned long phys_start_pfn,
end_sec = pfn_to_section_nr(phys_start_pfn + nr_pages - 1);

for (i = start_sec; i <= end_sec; i++) {
err = __add_section(nid, zone, i << PFN_SECTION_SHIFT);
err = __add_section(nid, zone, section_nr_to_pfn(i));

/*
* EEXIST is finally dealt with by ioresource collision
Expand Down

0 comments on commit 19c07d5

Please sign in to comment.