All of lore.kernel.org
 help / color / mirror / Atom feed
* + memory-hotplug-use-macro-to-switch-between-section-and-pfn.patch added to -mm tree
@ 2015-02-18 21:58 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2015-02-18 21:58 UTC (permalink / raw)
  To: shengyong1, mm-commits


The patch titled
     Subject: memory hotplug: use macro to switch between section and pfn
has been added to the -mm tree.  Its filename is
     memory-hotplug-use-macro-to-switch-between-section-and-pfn.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/memory-hotplug-use-macro-to-switch-between-section-and-pfn.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/memory-hotplug-use-macro-to-switch-between-section-and-pfn.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Sheng Yong <shengyong1@huawei.com>
Subject: memory hotplug: use macro to switch between section and pfn

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>
---

 drivers/base/memory.c |    2 +-
 mm/memory_hotplug.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/base/memory.c~memory-hotplug-use-macro-to-switch-between-section-and-pfn drivers/base/memory.c
--- a/drivers/base/memory.c~memory-hotplug-use-macro-to-switch-between-section-and-pfn
+++ a/drivers/base/memory.c
@@ -228,7 +228,7 @@ memory_block_action(unsigned long phys_i
 	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) {
diff -puN mm/memory_hotplug.c~memory-hotplug-use-macro-to-switch-between-section-and-pfn mm/memory_hotplug.c
--- a/mm/memory_hotplug.c~memory-hotplug-use-macro-to-switch-between-section-and-pfn
+++ a/mm/memory_hotplug.c
@@ -502,7 +502,7 @@ int __ref __add_pages(int nid, struct zo
 	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
_

Patches currently in -mm which might be from shengyong1@huawei.com are

memory-hotplug-use-macro-to-switch-between-section-and-pfn.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-18 21:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-18 21:58 + memory-hotplug-use-macro-to-switch-between-section-and-pfn.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.