linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/zsmalloc.c: use page_private() to access page->private
@ 2021-02-03  9:18 Miaohe Lin
  0 siblings, 0 replies; only message in thread
From: Miaohe Lin @ 2021-02-03  9:18 UTC (permalink / raw)
  To: akpm, minchan, ngupta, sergey.senozhatsky.work
  Cc: linux-mm, linux-kernel, linmiaohe

It's recommended to use helper macro page_private() to access the private
field of page. Use such helper to eliminate direct access.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/zsmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index cf0ed0e4e911..6678951ac83d 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -816,7 +816,7 @@ static int get_pages_per_zspage(int class_size)
 
 static struct zspage *get_zspage(struct page *page)
 {
-	struct zspage *zspage = (struct zspage *)page->private;
+	struct zspage *zspage = (struct zspage *)page_private(page);
 
 	BUG_ON(zspage->magic != ZSPAGE_MAGIC);
 	return zspage;
-- 
2.19.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-03  9:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03  9:18 [PATCH] mm/zsmalloc.c: use page_private() to access page->private Miaohe Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).