From: Matthew Wilcox (Oracle) Date: Tue, 27 Feb 2024 19:23:35 +0000 (+0000) Subject: mm: remove cast from page_to_nid() X-Git-Tag: v6.9-rc1~107^2~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9164448d3100d5118bda5e9d38b69a9f32cea509;p=thirdparty%2Flinux.git mm: remove cast from page_to_nid() Now that PF_POISONED_CHECK() can take a const argument, we can drop the cast. Link: https://lkml.kernel.org/r/20240227192337.757313-9-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton --- diff --git a/include/linux/mm.h b/include/linux/mm.h index 02547c8adda0c..699e850d143cf 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1641,13 +1641,11 @@ static inline int page_zone_id(struct page *page) } #ifdef NODE_NOT_IN_PAGE_FLAGS -extern int page_to_nid(const struct page *page); +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 (PF_POISONED_CHECK(p)->flags >> NODES_PGSHIFT) & NODES_MASK; + return (PF_POISONED_CHECK(page)->flags >> NODES_PGSHIFT) & NODES_MASK; } #endif