Re: [PATCH 1/3] mm: use zone_end_pfn() instead of zone_start_pfn+spanned_pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 7 Aug 2013 17:09:56 +0800 Xishi Qiu <qiuxishi@xxxxxxxxxx> 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);
_

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]