From 308a047c3f6b61cc4007c0051fe420197ea58f86 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Wed, 26 Oct 2016 19:43:43 +0200 Subject: x86/pat, mm: Make track_pfn_insert() return void It only returns 0 so we can save us the testing of its retval everywhere. Signed-off-by: Borislav Petkov Cc: Toshi Kani Cc: Denys Vlasenko Cc: Brian Gerst Cc: mcgrof@suse.com Cc: dri-devel@lists.freedesktop.org Cc: Andy Lutomirski Cc: Dave Airlie Cc: dan.j.williams@intel.com Cc: torvalds@linux-foundation.org Link: http://lkml.kernel.org/r/20161026174839.rusfxkm3xt4ennhe@pd.tnic Signed-off-by: Thomas Gleixner --- mm/huge_memory.c | 5 +++-- mm/memory.c | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'mm') diff --git a/mm/huge_memory.c b/mm/huge_memory.c index cdcd25cb30fe..113aaa4278b9 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -737,8 +737,9 @@ int vmf_insert_pfn_pmd(struct vm_area_struct *vma, unsigned long addr, if (addr < vma->vm_start || addr >= vma->vm_end) return VM_FAULT_SIGBUS; - if (track_pfn_insert(vma, &pgprot, pfn)) - return VM_FAULT_SIGBUS; + + track_pfn_insert(vma, &pgprot, pfn); + insert_pfn_pmd(vma, addr, pmd, pfn, pgprot, write); return VM_FAULT_NOPAGE; } diff --git a/mm/memory.c b/mm/memory.c index e18c57bdc75c..33f45edf8272 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1637,8 +1637,8 @@ int vm_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr, if (addr < vma->vm_start || addr >= vma->vm_end) return -EFAULT; - if (track_pfn_insert(vma, &pgprot, __pfn_to_pfn_t(pfn, PFN_DEV))) - return -EINVAL; + + track_pfn_insert(vma, &pgprot, __pfn_to_pfn_t(pfn, PFN_DEV)); ret = insert_pfn(vma, addr, __pfn_to_pfn_t(pfn, PFN_DEV), pgprot); @@ -1655,8 +1655,8 @@ int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr, if (addr < vma->vm_start || addr >= vma->vm_end) return -EFAULT; - if (track_pfn_insert(vma, &pgprot, pfn)) - return -EINVAL; + + track_pfn_insert(vma, &pgprot, pfn); /* * If we don't have pte special, then we have to use the pfn_valid() -- cgit v1.2.3