Skip to contentSkip to conversation

mm: remove unused early_pfn_valid()

PATCH Applied Mike Rapoport 3 participants 4 messages Sep 23, 2020 – Sep 28, 2020

Subsystems (3)
lore
Share & tools
lore

Mike Rapoport

author reviewer
#0 lore raw

PATCH 1/1 mm: remove unused early_pfn_valid()

From: Mike Rapoport <[email protected]>

The early_pfn_valid() macro is defined by it is never used. Remove it.

---
 include/linux/mmzone.h | 5 -----
 1 file changed, 5 deletions(-)
include/linux/mmzone.h +0 -5
index 8379432f4f2f..38264363b0d4 100644
@@ -1376,7 +1376,6 @@ static inline unsigned long next_present_section_nr(unsigned long section_nr)
 #define pfn_to_nid(pfn)		(0)
 #endif
 
-#define early_pfn_valid(pfn)	pfn_valid(pfn)
 void sparse_init(void);
 #else
 #define sparse_init()	do {} while (0)
@@ -1396,10 +1395,6 @@ struct mminit_pfnnid_cache {
 	int last_nid;
 };
 
-#ifndef early_pfn_valid
-#define early_pfn_valid(pfn)	(1)
-#endif
-
 /*
  * If it is possible to have holes within a MAX_ORDER_NR_PAGES, then we
  * need to check pfn validity within that MAX_ORDER_NR_PAGES block.
Signature · 1 line
2.28.0
Acked-by on v1 1/1
#1 lore raw
Quoted 24 lines · Mike Rapoport

From: Mike Rapoport <[email protected]>

The early_pfn_valid() macro is defined by it is never used. Remove it.

---
 include/linux/mmzone.h | 5 -----
 1 file changed, 5 deletions(-)
include/linux/mmzone.h +0 -1
index 8379432f4f2f..38264363b0d4 100644
@@ -1376,7 +1376,6 @@ static inline unsigned long next_present_section_nr(unsigned long section_nr)
 #define pfn_to_nid(pfn)		(0)
 #endif
 
-#define early_pfn_valid(pfn)	pfn_valid(pfn)
 void sparse_init(void);
 #else
 #define sparse_init()	do {} while (0)

include/linux/mmzone.h struct mminit_pfnnid_cache { · line 1400

Quoted 10 lines
include/linux/mmzone.h +0 -4
@@ -1396,10 +1395,6 @@ struct mminit_pfnnid_cache {
 	int last_nid;
 };
 
-#ifndef early_pfn_valid
-#define early_pfn_valid(pfn)	(1)
-#endif
-
 /*
  * If it is possible to have holes within a MAX_ORDER_NR_PAGES, then we
  * need to check pfn validity within that MAX_ORDER_NR_PAGES block.

Think the last user was removed with

commit 73a6e474cb376921a311786652782155eac2fdf0

Author: Baoquan He <[email protected]>
Date:   Wed Jun 3 15:57:55 2020 -0700

mm: memmap_init: iterate over memblock regions rather that check
each PFN

When called during boot the memmap_init_zone() function checks if
each PFN
is valid and actually belongs to the node being initialized using early_pfn_valid() and early_pfn_in_nid().

Signature · 3 lines
Thanks,

David / dhildenb
author reviewer
#2 lore raw
In reply to Mike Rapoport

ping?

Quoted 36 lines · Mike Rapoport

From: Mike Rapoport <[email protected]>

The early_pfn_valid() macro is defined by it is never used. Remove it.

---
 include/linux/mmzone.h | 5 -----
 1 file changed, 5 deletions(-)
include/linux/mmzone.h +0 -5
index 8379432f4f2f..38264363b0d4 100644
@@ -1376,7 +1376,6 @@ static inline unsigned long next_present_section_nr(unsigned long section_nr)
 #define pfn_to_nid(pfn)		(0)
 #endif
 
-#define early_pfn_valid(pfn)	pfn_valid(pfn)
 void sparse_init(void);
 #else
 #define sparse_init()	do {} while (0)
@@ -1396,10 +1395,6 @@ struct mminit_pfnnid_cache {
 	int last_nid;
 };
 
-#ifndef early_pfn_valid
-#define early_pfn_valid(pfn)	(1)
-#endif
-
 /*
  * If it is possible to have holes within a MAX_ORDER_NR_PAGES, then we
  * need to check pfn validity within that MAX_ORDER_NR_PAGES block.
Signature · 1 line
2.28.0
Signature · 2 lines
Sincerely yours,
Mike.