ANDROID: Fix sparse warning in __handle_speculative_fault caused by SPF

SPF patchset introduced a sparse warning caused by the mismatch in
__handle_speculative_fault function's return type. Fix the return
type.

Fixes: 1c53717440 ("FROMLIST: mm: provide speculative fault infrastructure")

Bug: 161210518
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I27c75f2b3729fa5d4b610f4a1829c9beba29735c
This commit is contained in:
Suren Baghdasaryan 2021-02-03 17:16:09 -08:00
parent aef918d19a
commit 9e4d84273c
2 changed files with 17 additions and 15 deletions

View File

@ -1749,14 +1749,14 @@ extern int fixup_user_fault(struct mm_struct *mm,
bool *unlocked);
#ifdef CONFIG_SPECULATIVE_PAGE_FAULT
extern int __handle_speculative_fault(struct mm_struct *mm,
unsigned long address,
unsigned int flags,
struct vm_area_struct **vma);
static inline int handle_speculative_fault(struct mm_struct *mm,
unsigned long address,
unsigned int flags,
struct vm_area_struct **vma)
extern vm_fault_t __handle_speculative_fault(struct mm_struct *mm,
unsigned long address,
unsigned int flags,
struct vm_area_struct **vma);
static inline vm_fault_t handle_speculative_fault(struct mm_struct *mm,
unsigned long address,
unsigned int flags,
struct vm_area_struct **vma)
{
/*
* Try speculative page fault for multithreaded user space task only.
@ -1770,10 +1770,10 @@ static inline int handle_speculative_fault(struct mm_struct *mm,
extern bool can_reuse_spf_vma(struct vm_area_struct *vma,
unsigned long address);
#else
static inline int handle_speculative_fault(struct mm_struct *mm,
unsigned long address,
unsigned int flags,
struct vm_area_struct **vma)
static inline vm_fault_t handle_speculative_fault(struct mm_struct *mm,
unsigned long address,
unsigned int flags,
struct vm_area_struct **vma)
{
return VM_FAULT_RETRY;
}

View File

@ -4841,8 +4841,9 @@ static inline void mm_account_fault(struct pt_regs *regs,
* This is needed as the returned vma is kept in memory until the call to
* can_reuse_spf_vma() is made.
*/
int __handle_speculative_fault(struct mm_struct *mm, unsigned long address,
unsigned int flags, struct vm_area_struct **vma)
vm_fault_t __handle_speculative_fault(struct mm_struct *mm,
unsigned long address, unsigned int flags,
struct vm_area_struct **vma)
{
struct vm_fault vmf = {
.address = address,
@ -4850,7 +4851,8 @@ int __handle_speculative_fault(struct mm_struct *mm, unsigned long address,
pgd_t *pgd, pgdval;
p4d_t *p4d, p4dval;
pud_t pudval;
int seq, ret;
int seq;
vm_fault_t ret;
/* Clear flags that may lead to release the mmap_sem to retry */
flags &= ~(FAULT_FLAG_ALLOW_RETRY|FAULT_FLAG_KILLABLE);