Skip to content

Commit 00b3a33

Browse files
Laurent Dufourtorvalds
authored andcommitted
mm: remove odd HAVE_PTE_SPECIAL
Remove the additional define HAVE_PTE_SPECIAL and rely directly on CONFIG_ARCH_HAS_PTE_SPECIAL. There is no functional change introduced by this patch Link: http://lkml.kernel.org/r/1523533733-25437-1-git-send-email-ldufour@linux.vnet.ibm.com Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com> Acked-by: David Rientjes <rientjes@google.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Jerome Glisse <jglisse@redhat.com> Cc: Michal Hocko <mhocko@kernel.org> Cc: Christophe LEROY <christophe.leroy@c-s.fr> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 3010a5e commit 00b3a33

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

mm/memory.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -817,17 +817,12 @@ static void print_bad_pte(struct vm_area_struct *vma, unsigned long addr,
817817
* PFNMAP mappings in order to support COWable mappings.
818818
*
819819
*/
820-
#ifdef CONFIG_ARCH_HAS_PTE_SPECIAL
821-
# define HAVE_PTE_SPECIAL 1
822-
#else
823-
# define HAVE_PTE_SPECIAL 0
824-
#endif
825820
struct page *_vm_normal_page(struct vm_area_struct *vma, unsigned long addr,
826821
pte_t pte, bool with_public_device)
827822
{
828823
unsigned long pfn = pte_pfn(pte);
829824

830-
if (HAVE_PTE_SPECIAL) {
825+
if (IS_ENABLED(CONFIG_ARCH_HAS_PTE_SPECIAL)) {
831826
if (likely(!pte_special(pte)))
832827
goto check_pfn;
833828
if (vma->vm_ops && vma->vm_ops->find_special_page)
@@ -862,7 +857,7 @@ struct page *_vm_normal_page(struct vm_area_struct *vma, unsigned long addr,
862857
return NULL;
863858
}
864859

865-
/* !HAVE_PTE_SPECIAL case follows: */
860+
/* !CONFIG_ARCH_HAS_PTE_SPECIAL case follows: */
866861

867862
if (unlikely(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP))) {
868863
if (vma->vm_flags & VM_MIXEDMAP) {
@@ -881,6 +876,7 @@ struct page *_vm_normal_page(struct vm_area_struct *vma, unsigned long addr,
881876

882877
if (is_zero_pfn(pfn))
883878
return NULL;
879+
884880
check_pfn:
885881
if (unlikely(pfn > highest_memmap_pfn)) {
886882
print_bad_pte(vma, addr, pte, NULL);
@@ -904,7 +900,7 @@ struct page *vm_normal_page_pmd(struct vm_area_struct *vma, unsigned long addr,
904900
/*
905901
* There is no pmd_special() but there may be special pmds, e.g.
906902
* in a direct-access (dax) mapping, so let's just replicate the
907-
* !HAVE_PTE_SPECIAL case from vm_normal_page() here.
903+
* !CONFIG_ARCH_HAS_PTE_SPECIAL case from vm_normal_page() here.
908904
*/
909905
if (unlikely(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP))) {
910906
if (vma->vm_flags & VM_MIXEDMAP) {
@@ -1933,7 +1929,8 @@ static int __vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr,
19331929
* than insert_pfn). If a zero_pfn were inserted into a VM_MIXEDMAP
19341930
* without pte special, it would there be refcounted as a normal page.
19351931
*/
1936-
if (!HAVE_PTE_SPECIAL && !pfn_t_devmap(pfn) && pfn_t_valid(pfn)) {
1932+
if (!IS_ENABLED(CONFIG_ARCH_HAS_PTE_SPECIAL) &&
1933+
!pfn_t_devmap(pfn) && pfn_t_valid(pfn)) {
19371934
struct page *page;
19381935

19391936
/*

0 commit comments

Comments
 (0)