mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Xishi Qiu <qiuxishi@huawei.com>
Cc: Cody P Schafer <cody@linux.vnet.ibm.com>, <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] mm: use zone_end_pfn() instead of zone_start_pfn+spanned_pages
Date: Tue, 13 Aug 2013 13:15:10 -0700	[thread overview]
Message-ID: <20130813131510.59ef74bce81d9352f8590218@linux-foundation.org> (raw)
In-Reply-To: <52020EE4.1090606@huawei.com>

On Wed, 7 Aug 2013 17:09:56 +0800 Xishi Qiu <qiuxishi@huawei.com> wrote:

> Use "zone_end_pfn()" instead of "zone->zone_start_pfn + zone->spanned_pages".
> Simplify the code, no functional change.

This doesn't compile.

mm/memory_hotplug.c: In function 'shrink_zone_span':
mm/memory_hotplug.c:518: error: called object 'zone_end_pfn' is not a function

>  kernel/power/snapshot.c |   12 ++++++------
>  mm/memory_hotplug.c     |    4 ++--

It's only two files - did you test it?

I couldn't see any vaguely acceptable way of renaming the variables to
fix this, so I did a hack which permits us to keep the current naming.
Any better ideas?

--- a/mm/memory_hotplug.c~mm-use-zone_end_pfn-instead-of-zone_start_pfnspanned_pages-fix
+++ a/mm/memory_hotplug.c
@@ -514,8 +514,9 @@ static int find_biggest_section_pfn(int
 static void shrink_zone_span(struct zone *zone, unsigned long start_pfn,
 			     unsigned long end_pfn)
 {
-	unsigned long zone_start_pfn =  zone->zone_start_pfn;
-	unsigned long zone_end_pfn = zone_end_pfn(zone);
+	unsigned long zone_start_pfn = zone->zone_start_pfn;
+	unsigned long z = zone_end_pfn(zone); /* zone_end_pfn namespace clash */
+	unsigned long zone_end_pfn = z;
 	unsigned long pfn;
 	struct mem_section *ms;
 	int nid = zone_to_nid(zone);
_


      reply	other threads:[~2013-08-13 20:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-07  9:09 Xishi Qiu
2013-08-13 20:15 ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130813131510.59ef74bce81d9352f8590218@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cody@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=qiuxishi@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®