diff mbox series

[2/2] mm/memmap_init: Update variable name in memmap_init_zone

Message ID 20190926122552.17905-2-aneesh.kumar@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series [1/2] mm/memunmap: Use the correct start and end pfn when removing pages from zone | expand

Commit Message

Aneesh Kumar K.V Sept. 26, 2019, 12:25 p.m. UTC
The third argument is actually number of pages. Changes the variable name
from size to nr_pages to indicate this better.

No functional change in this patch.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 mm/page_alloc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

David Hildenbrand Sept. 26, 2019, 12:56 p.m. UTC | #1
On 26.09.19 14:25, Aneesh Kumar K.V wrote:
> The third argument is actually number of pages. Changes the variable name
> from size to nr_pages to indicate this better.
> 
> No functional change in this patch.
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> ---
>  mm/page_alloc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 3334a769eb91..df9e09a5359f 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -5914,10 +5914,10 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
>  #ifdef CONFIG_ZONE_DEVICE
>  void __ref memmap_init_zone_device(struct zone *zone,
>  				   unsigned long start_pfn,
> -				   unsigned long size,
> +				   unsigned long nr_pages,
>  				   struct dev_pagemap *pgmap)
>  {
> -	unsigned long pfn, end_pfn = start_pfn + size;
> +	unsigned long pfn, end_pfn = start_pfn + nr_pages;
>  	struct pglist_data *pgdat = zone->zone_pgdat;
>  	struct vmem_altmap *altmap = pgmap_altmap(pgmap);
>  	unsigned long zone_idx = zone_idx(zone);
> @@ -5934,7 +5934,7 @@ void __ref memmap_init_zone_device(struct zone *zone,
>  	 */
>  	if (altmap) {
>  		start_pfn = altmap->base_pfn + vmem_altmap_offset(altmap);
> -		size = end_pfn - start_pfn;
> +		nr_pages = end_pfn - start_pfn;
>  	}
>  
>  	for (pfn = start_pfn; pfn < end_pfn; pfn++) {
> @@ -5981,7 +5981,7 @@ void __ref memmap_init_zone_device(struct zone *zone,
>  	}
>  
>  	pr_info("%s initialised %lu pages in %ums\n", __func__,
> -		size, jiffies_to_msecs(jiffies - start));
> +		nr_pages, jiffies_to_msecs(jiffies - start));
>  }
>  
>  #endif
> 

Reviewed-by: David Hildenbrand <david@redhat.com>
Pankaj Gupta Sept. 26, 2019, 1:38 p.m. UTC | #2
> 
> The third argument is actually number of pages. Changes the variable name
> from size to nr_pages to indicate this better.
> 
> No functional change in this patch.
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> ---
>  mm/page_alloc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 3334a769eb91..df9e09a5359f 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -5914,10 +5914,10 @@ void __meminit memmap_init_zone(unsigned long size,
> int nid, unsigned long zone,
>  #ifdef CONFIG_ZONE_DEVICE
>  void __ref memmap_init_zone_device(struct zone *zone,
>  				   unsigned long start_pfn,
> -				   unsigned long size,
> +				   unsigned long nr_pages,
>  				   struct dev_pagemap *pgmap)
>  {
> -	unsigned long pfn, end_pfn = start_pfn + size;
> +	unsigned long pfn, end_pfn = start_pfn + nr_pages;
>  	struct pglist_data *pgdat = zone->zone_pgdat;
>  	struct vmem_altmap *altmap = pgmap_altmap(pgmap);
>  	unsigned long zone_idx = zone_idx(zone);
> @@ -5934,7 +5934,7 @@ void __ref memmap_init_zone_device(struct zone *zone,
>  	 */
>  	if (altmap) {
>  		start_pfn = altmap->base_pfn + vmem_altmap_offset(altmap);
> -		size = end_pfn - start_pfn;
> +		nr_pages = end_pfn - start_pfn;
>  	}
>  
>  	for (pfn = start_pfn; pfn < end_pfn; pfn++) {
> @@ -5981,7 +5981,7 @@ void __ref memmap_init_zone_device(struct zone *zone,
>  	}
>  
>  	pr_info("%s initialised %lu pages in %ums\n", __func__,
> -		size, jiffies_to_msecs(jiffies - start));
> +		nr_pages, jiffies_to_msecs(jiffies - start));
>  }
>  
>  #endif
> --
> 2.21.0

Reviewed-by: Pankaj Gupta <pagupta@redhat.com>

> 
> 
>
diff mbox series

Patch

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 3334a769eb91..df9e09a5359f 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5914,10 +5914,10 @@  void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
 #ifdef CONFIG_ZONE_DEVICE
 void __ref memmap_init_zone_device(struct zone *zone,
 				   unsigned long start_pfn,
-				   unsigned long size,
+				   unsigned long nr_pages,
 				   struct dev_pagemap *pgmap)
 {
-	unsigned long pfn, end_pfn = start_pfn + size;
+	unsigned long pfn, end_pfn = start_pfn + nr_pages;
 	struct pglist_data *pgdat = zone->zone_pgdat;
 	struct vmem_altmap *altmap = pgmap_altmap(pgmap);
 	unsigned long zone_idx = zone_idx(zone);
@@ -5934,7 +5934,7 @@  void __ref memmap_init_zone_device(struct zone *zone,
 	 */
 	if (altmap) {
 		start_pfn = altmap->base_pfn + vmem_altmap_offset(altmap);
-		size = end_pfn - start_pfn;
+		nr_pages = end_pfn - start_pfn;
 	}
 
 	for (pfn = start_pfn; pfn < end_pfn; pfn++) {
@@ -5981,7 +5981,7 @@  void __ref memmap_init_zone_device(struct zone *zone,
 	}
 
 	pr_info("%s initialised %lu pages in %ums\n", __func__,
-		size, jiffies_to_msecs(jiffies - start));
+		nr_pages, jiffies_to_msecs(jiffies - start));
 }
 
 #endif