All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] memblock: remove unneeded local variable nid
@ 2022-02-17 14:07 Miaohe Lin
  2022-02-17 21:53 ` Mike Rapoport
  0 siblings, 1 reply; 2+ messages in thread
From: Miaohe Lin @ 2022-02-17 14:07 UTC (permalink / raw)
  To: akpm, rppt; +Cc: linux-mm, linux-kernel, linmiaohe

The nid is only used to act as output parameter of __next_mem_range.
Since NULL can be passed to __next_mem_range as out_nid, we can thus
remove nid by passing NULL here.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/memblock.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/memblock.c b/mm/memblock.c
index 1018e50566f3..11561bbff8f5 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -1278,11 +1278,10 @@ __next_mem_pfn_range_in_zone(u64 *idx, struct zone *zone,
 {
 	int zone_nid = zone_to_nid(zone);
 	phys_addr_t spa, epa;
-	int nid;
 
 	__next_mem_range(idx, zone_nid, MEMBLOCK_NONE,
 			 &memblock.memory, &memblock.reserved,
-			 &spa, &epa, &nid);
+			 &spa, &epa, NULL);
 
 	while (*idx != U64_MAX) {
 		unsigned long epfn = PFN_DOWN(epa);
@@ -1309,7 +1308,7 @@ __next_mem_pfn_range_in_zone(u64 *idx, struct zone *zone,
 
 		__next_mem_range(idx, zone_nid, MEMBLOCK_NONE,
 				 &memblock.memory, &memblock.reserved,
-				 &spa, &epa, &nid);
+				 &spa, &epa, NULL);
 	}
 
 	/* signal end of iteration */
-- 
2.23.0


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

* Re: [PATCH] memblock: remove unneeded local variable nid
  2022-02-17 14:07 [PATCH] memblock: remove unneeded local variable nid Miaohe Lin
@ 2022-02-17 21:53 ` Mike Rapoport
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Rapoport @ 2022-02-17 21:53 UTC (permalink / raw)
  To: rppt, Miaohe Lin, akpm; +Cc: Mike Rapoport, linux-kernel, linux-mm

From: Mike Rapoport <rppt@linux.ibm.com>

On Thu, 17 Feb 2022 22:07:54 +0800, Miaohe Lin wrote:
> The nid is only used to act as output parameter of __next_mem_range.
> Since NULL can be passed to __next_mem_range as out_nid, we can thus
> remove nid by passing NULL here.
> 
> 

Applied, thanks!

[1/1] memblock: remove unneeded local variable nid
      (no commit info)

Best regards,
-- 
Sincerely yours,
Mike.


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

end of thread, other threads:[~2022-02-17 21:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-17 14:07 [PATCH] memblock: remove unneeded local variable nid Miaohe Lin
2022-02-17 21:53 ` Mike Rapoport

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.