[PATCH 3/5] mm: Remove casting away of constness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx>

Now that dump_page can take a const struct page pointer, we can get rid
of the cast in page_to_nid().
---
 include/linux/mm.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 933450bdcfd4..047144b894bd 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1246,9 +1246,7 @@ extern int page_to_nid(const struct page *page);
 #else
 static inline int page_to_nid(const struct page *page)
 {
-	struct page *p = (struct page *)page;
-
-	return (page_poison_check(p)->flags >> NODES_PGSHIFT) & NODES_MASK;
+	return (page_poison_check(page)->flags >> NODES_PGSHIFT) & NODES_MASK;
 }
 #endif
 
-- 
2.25.1





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux