Message ID | 20200408150148.25290-4-willy@infradead.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Improve page poisoning implementation | expand |
On Wed, Apr 8, 2020 at 11:01 AM Matthew Wilcox <willy@infradead.org> wrote: > > From: "Matthew Wilcox (Oracle)" <willy@infradead.org> > > Now that dump_page can take a const struct page pointer, we can get rid > of the cast in page_to_nid(). Missing Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> ? Reviewed-by: Pavel Tatashin <pasha.tatashin@soleen.com>
On Wed, Apr 08, 2020 at 08:01:46AM -0700, Matthew Wilcox wrote: > From: "Matthew Wilcox (Oracle)" <willy@infradead.org> > > Now that dump_page can take a const struct page pointer, we can get rid ^ () > of the cast in page_to_nid(). It took me a minute to understand how page_to_nid() related to dump_page(). Please elaborate in the commit message. Otherwise, looks good. Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
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
From: "Matthew Wilcox (Oracle)" <willy@infradead.org> 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(-)