mm/zsmalloc.c: use page_private() to access page->private
authorMiaohe Lin <linmiaohe@huawei.com>
Fri, 26 Feb 2021 01:18:34 +0000 (17:18 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 26 Feb 2021 17:41:01 +0000 (09:41 -0800)
It's recommended to use helper macro page_private() to access the private
field of page.  Use such helper to eliminate direct access.

Link: https://lkml.kernel.org/r/20210203091857.20017-1-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/zsmalloc.c

index 1518732..30c358b 100644 (file)
@@ -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;