Skip to contentSkip to conversation

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

PATCH Applied Miaohe Lin 1 participant 1 message Feb 3, 2021

Subsystems (2)
lore
Share & tools
lore

Miaohe Lin

author
#0 lore raw

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

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

---
 mm/zsmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/zsmalloc.c +1 -1
index cf0ed0e4e911..6678951ac83d 100644
@@ -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;
Signature · 1 line
2.19.1