diff mbox series

mm/zsmalloc.c: use page_private() to access page->private

Message ID 20210203091857.20017-1-linmiaohe@huawei.com (mailing list archive)
State New, archived
Headers show
Series mm/zsmalloc.c: use page_private() to access page->private | expand

Commit Message

Miaohe Lin Feb. 3, 2021, 9:18 a.m. UTC
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 mbox series

Patch

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;