fs/proc/task_mmu.c: remove redundant page validation of pte_page
authorXianting Tian <xianting.tian@linux.alibaba.com>
Fri, 29 Apr 2022 06:16:04 +0000 (23:16 -0700)
committerakpm <akpm@linux-foundation.org>
Fri, 29 Apr 2022 06:16:04 +0000 (23:16 -0700)
pte_page() always returns a valid page, so remove the redundant page
validation, as we did in many other places.

Link: https://lkml.kernel.org/r/20220316025947.328276-1-xianting.tian@linux.alibaba.com
Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Sasha Levin <sashal@kernel.org>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/proc/task_mmu.c

index f46060e..a843d13 100644 (file)
@@ -1873,8 +1873,6 @@ static int gather_hugetlb_stats(pte_t *pte, unsigned long hmask,
                return 0;
 
        page = pte_page(huge_pte);
-       if (!page)
-               return 0;
 
        md = walk->private;
        gather_stats(page, md, pte_dirty(huge_pte), 1);