summaryrefslogtreecommitdiff
path: root/mm/pgtable-generic.c
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2021-02-24 23:04:36 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2021-02-25 00:38:30 +0300
commitc045c72ccde3a267963f8e85f388db4c40dea3b3 (patch)
tree90b73722638b853079536fa8b453acda7e4d7073 /mm/pgtable-generic.c
parent90a3e375d324b2255b83e3dd29e99e2b05d82aaf (diff)
downloadlinux-c045c72ccde3a267963f8e85f388db4c40dea3b3.tar.xz
mm/pgtable-generic.c: simplify the VM_BUG_ON condition in pmdp_huge_clear_flush()
The condition (A && !C && !D) || !A is equivalent to !A || (A && !C && !D) and can be further simplified to !A || (!C && !D). Link: https://lkml.kernel.org/r/20210201114319.34720-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/pgtable-generic.c')
-rw-r--r--mm/pgtable-generic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
index 9578db83e312..fa1375f3e3b2 100644
--- a/mm/pgtable-generic.c
+++ b/mm/pgtable-generic.c
@@ -135,8 +135,8 @@ pmd_t pmdp_huge_clear_flush(struct vm_area_struct *vma, unsigned long address,
{
pmd_t pmd;
VM_BUG_ON(address & ~HPAGE_PMD_MASK);
- VM_BUG_ON((pmd_present(*pmdp) && !pmd_trans_huge(*pmdp) &&
- !pmd_devmap(*pmdp)) || !pmd_present(*pmdp));
+ VM_BUG_ON(!pmd_present(*pmdp) || (!pmd_trans_huge(*pmdp) &&
+ !pmd_devmap(*pmdp)));
pmd = pmdp_huge_get_and_clear(vma->vm_mm, address, pmdp);
flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE);
return pmd;