Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 308a047c authored by Borislav Petkov's avatar Borislav Petkov Committed by Thomas Gleixner
Browse files

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: default avatarBorislav Petkov <bp@suse.de>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: mcgrof@suse.com
Cc: dri-devel@lists.freedesktop.org
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Dave Airlie <airlied@redhat.com>
Cc: dan.j.williams@intel.com
Cc: torvalds@linux-foundation.org
Link: http://lkml.kernel.org/r/20161026174839.rusfxkm3xt4ennhe@pd.tnic


Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent bc33b0ca
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -986,20 +986,17 @@ int track_pfn_remap(struct vm_area_struct *vma, pgprot_t *prot,
	return 0;
	return 0;
}
}


int track_pfn_insert(struct vm_area_struct *vma, pgprot_t *prot,
void track_pfn_insert(struct vm_area_struct *vma, pgprot_t *prot, pfn_t pfn)
		     pfn_t pfn)
{
{
	enum page_cache_mode pcm;
	enum page_cache_mode pcm;


	if (!pat_enabled())
	if (!pat_enabled())
		return 0;
		return;


	/* Set prot based on lookup */
	/* Set prot based on lookup */
	pcm = lookup_memtype(pfn_t_to_phys(pfn));
	pcm = lookup_memtype(pfn_t_to_phys(pfn));
	*prot = __pgprot((pgprot_val(*prot) & (~_PAGE_CACHE_MASK)) |
	*prot = __pgprot((pgprot_val(*prot) & (~_PAGE_CACHE_MASK)) |
			 cachemode2protval(pcm));
			 cachemode2protval(pcm));

	return 0;
}
}


/*
/*
+4 −5
Original line number Original line Diff line number Diff line
@@ -558,10 +558,9 @@ static inline int track_pfn_remap(struct vm_area_struct *vma, pgprot_t *prot,
 * track_pfn_insert is called when a _new_ single pfn is established
 * track_pfn_insert is called when a _new_ single pfn is established
 * by vm_insert_pfn().
 * by vm_insert_pfn().
 */
 */
static inline int track_pfn_insert(struct vm_area_struct *vma, pgprot_t *prot,
static inline void track_pfn_insert(struct vm_area_struct *vma, pgprot_t *prot,
				    pfn_t pfn)
				    pfn_t pfn)
{
{
	return 0;
}
}


/*
/*
@@ -593,7 +592,7 @@ static inline void untrack_pfn_moved(struct vm_area_struct *vma)
extern int track_pfn_remap(struct vm_area_struct *vma, pgprot_t *prot,
extern int track_pfn_remap(struct vm_area_struct *vma, pgprot_t *prot,
			   unsigned long pfn, unsigned long addr,
			   unsigned long pfn, unsigned long addr,
			   unsigned long size);
			   unsigned long size);
extern int track_pfn_insert(struct vm_area_struct *vma, pgprot_t *prot,
extern void track_pfn_insert(struct vm_area_struct *vma, pgprot_t *prot,
			     pfn_t pfn);
			     pfn_t pfn);
extern int track_pfn_copy(struct vm_area_struct *vma);
extern int track_pfn_copy(struct vm_area_struct *vma);
extern void untrack_pfn(struct vm_area_struct *vma, unsigned long pfn,
extern void untrack_pfn(struct vm_area_struct *vma, unsigned long pfn,
+3 −2
Original line number Original line Diff line number Diff line
@@ -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)
	if (addr < vma->vm_start || addr >= vma->vm_end)
		return VM_FAULT_SIGBUS;
		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);
	insert_pfn_pmd(vma, addr, pmd, pfn, pgprot, write);
	return VM_FAULT_NOPAGE;
	return VM_FAULT_NOPAGE;
}
}
+4 −4
Original line number Original line Diff line number Diff line
@@ -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)
	if (addr < vma->vm_start || addr >= vma->vm_end)
		return -EFAULT;
		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);
	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)
	if (addr < vma->vm_start || addr >= vma->vm_end)
		return -EFAULT;
		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()
	 * If we don't have pte special, then we have to use the pfn_valid()