Skip to contentSkip to conversation

mm: fix the try_to_unmap prototype for !CONFIG_MMU

PATCH In review Christoph Hellwig 2 participants 2 messages Jul 5, 2021 – Jul 6, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: fix the try_to_unmap prototype for !CONFIG_MMU

Adjust the nommu stub of try_to_unmap to match the changed protype for the full version. Turn it into an inline instead of a macro to generally improve the type checking.

Fixes 1fb08ac63bee ("mm: rmap: make try_to_unmap() void function")
---
 include/linux/rmap.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
include/linux/rmap.h +3 -1
index 83fb86133fe1..c976cc6de257 100644
@@ -291,7 +291,9 @@ static inline int page_referenced(struct page *page, int is_locked,
 	return 0;
 }
 
-#define try_to_unmap(page, refs) false
+static inline void try_to_unmap(struct page *page, enum ttu_flags flags)
+{
+}
 
 static inline int page_mkclean(struct page *page)
 {
Signature · 1 line
2.30.2
#1 lore raw
Quoted 4 lines · Christoph Hellwig

Adjust the nommu stub of try_to_unmap to match the changed protype for the full version. Turn it into an inline instead of a macro to generally improve the type checking.

Thanks for catching this. Reviewed-by: Yang Shi <[email protected]>

Quoted 26 lines
Fixes 1fb08ac63bee ("mm: rmap: make try_to_unmap() void function")
---
 include/linux/rmap.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
include/linux/rmap.h +3 -2
index 83fb86133fe1..c976cc6de257 100644
@@ -291,7 +291,9 @@ static inline int page_referenced(struct page *page, int is_locked,
        return 0;
 }
 
-#define try_to_unmap(page, refs) false
+static inline void try_to_unmap(struct page *page, enum ttu_flags flags)
+{
+}
 
 static inline int page_mkclean(struct page *page)
 {
--

2.30.2