linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: memblock: remove return value of memblock_free_all()
@ 2021-01-14  7:08 Daeseok Youn
  2021-01-14  9:21 ` David Hildenbrand
  2021-01-14 13:38 ` Mike Rapoport
  0 siblings, 2 replies; 3+ messages in thread
From: Daeseok Youn @ 2021-01-14  7:08 UTC (permalink / raw)
  To: rppt, akpm, linux-mm, linux-kernel, kernel-janitors

No one checks the return value of memblock_free_all().
Make the return value void.

memblock_free_all() is used on mem_init() for each
architecture, and the total count of freed pages will be added
to _totalram_pages variable by calling totalram_pages_add().

so do not need to return total count of freed pages.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
 include/linux/memblock.h | 2 +-
 mm/memblock.c            | 6 +-----
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 9c5cc95c7cee..076fda398dff 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -117,7 +117,7 @@ int memblock_mark_mirror(phys_addr_t base, phys_addr_t size);
 int memblock_mark_nomap(phys_addr_t base, phys_addr_t size);
 int memblock_clear_nomap(phys_addr_t base, phys_addr_t size);
 
-unsigned long memblock_free_all(void);
+void memblock_free_all(void);
 void reset_node_managed_pages(pg_data_t *pgdat);
 void reset_all_zones_managed_pages(void);
 void memblock_enforce_memory_reserved_overlap(void);
diff --git a/mm/memblock.c b/mm/memblock.c
index 40ca30bfa387..2a2b1fe4b659 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -2074,10 +2074,8 @@ void __init reset_all_zones_managed_pages(void)
 
 /**
  * memblock_free_all - release free pages to the buddy allocator
- *
- * Return: the number of pages actually released.
  */
-unsigned long __init memblock_free_all(void)
+void __init memblock_free_all(void)
 {
 	unsigned long pages;
 
@@ -2086,8 +2084,6 @@ unsigned long __init memblock_free_all(void)
 
 	pages = free_low_memory_core_early();
 	totalram_pages_add(pages);
-
-	return pages;
 }
 
 #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_ARCH_KEEP_MEMBLOCK)
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm: memblock: remove return value of memblock_free_all()
  2021-01-14  7:08 [PATCH] mm: memblock: remove return value of memblock_free_all() Daeseok Youn
@ 2021-01-14  9:21 ` David Hildenbrand
  2021-01-14 13:38 ` Mike Rapoport
  1 sibling, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2021-01-14  9:21 UTC (permalink / raw)
  To: Daeseok Youn, rppt, akpm, linux-mm, linux-kernel, kernel-janitors

On 14.01.21 08:08, Daeseok Youn wrote:
> No one checks the return value of memblock_free_all().
> Make the return value void.
> 
> memblock_free_all() is used on mem_init() for each
> architecture, and the total count of freed pages will be added
> to _totalram_pages variable by calling totalram_pages_add().
> 
> so do not need to return total count of freed pages.
> 
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
>  include/linux/memblock.h | 2 +-
>  mm/memblock.c            | 6 +-----
>  2 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/include/linux/memblock.h b/include/linux/memblock.h
> index 9c5cc95c7cee..076fda398dff 100644
> --- a/include/linux/memblock.h
> +++ b/include/linux/memblock.h
> @@ -117,7 +117,7 @@ int memblock_mark_mirror(phys_addr_t base, phys_addr_t size);
>  int memblock_mark_nomap(phys_addr_t base, phys_addr_t size);
>  int memblock_clear_nomap(phys_addr_t base, phys_addr_t size);
>  
> -unsigned long memblock_free_all(void);
> +void memblock_free_all(void);
>  void reset_node_managed_pages(pg_data_t *pgdat);
>  void reset_all_zones_managed_pages(void);
>  void memblock_enforce_memory_reserved_overlap(void);
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 40ca30bfa387..2a2b1fe4b659 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -2074,10 +2074,8 @@ void __init reset_all_zones_managed_pages(void)
>  
>  /**
>   * memblock_free_all - release free pages to the buddy allocator
> - *
> - * Return: the number of pages actually released.
>   */
> -unsigned long __init memblock_free_all(void)
> +void __init memblock_free_all(void)
>  {
>  	unsigned long pages;
>  
> @@ -2086,8 +2084,6 @@ unsigned long __init memblock_free_all(void)
>  
>  	pages = free_low_memory_core_early();
>  	totalram_pages_add(pages);
> -
> -	return pages;
>  }
>  
>  #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_ARCH_KEEP_MEMBLOCK)
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm: memblock: remove return value of memblock_free_all()
  2021-01-14  7:08 [PATCH] mm: memblock: remove return value of memblock_free_all() Daeseok Youn
  2021-01-14  9:21 ` David Hildenbrand
@ 2021-01-14 13:38 ` Mike Rapoport
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Rapoport @ 2021-01-14 13:38 UTC (permalink / raw)
  To: Daeseok Youn; +Cc: akpm, linux-mm, linux-kernel, kernel-janitors

On Thu, Jan 14, 2021 at 04:08:17PM +0900, Daeseok Youn wrote:
> No one checks the return value of memblock_free_all().
> Make the return value void.
> 
> memblock_free_all() is used on mem_init() for each
> architecture, and the total count of freed pages will be added
> to _totalram_pages variable by calling totalram_pages_add().
> 
> so do not need to return total count of freed pages.
> 
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>

Applied to memblock/for-next, thanks!

-- 
Sincerely yours,
Mike.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-14 13:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14  7:08 [PATCH] mm: memblock: remove return value of memblock_free_all() Daeseok Youn
2021-01-14  9:21 ` David Hildenbrand
2021-01-14 13:38 ` Mike Rapoport

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).