From 3eb87d4e5a93fcd89631e440e46c1c4da59fc94f Mon Sep 17 00:00:00 2001 From: Souptick Joarder Date: Mon, 16 Apr 2018 19:56:09 +0530 Subject: char: mspec: change return type to vm_fault_t Use new return type vm_fault_t for the fault handler in struct vm_operations_struct. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. This driver failed to handle any error returned by vm_insert_pfn. Use the new vmf_insert_pfn function to return the correct value. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox Signed-off-by: Greg Kroah-Hartman --- drivers/char/mspec.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'drivers/char') diff --git a/drivers/char/mspec.c b/drivers/char/mspec.c index 7b75669d3670..058876b55b09 100644 --- a/drivers/char/mspec.c +++ b/drivers/char/mspec.c @@ -191,7 +191,7 @@ mspec_close(struct vm_area_struct *vma) * * Creates a mspec page and maps it to user space. */ -static int +static vm_fault_t mspec_fault(struct vm_fault *vmf) { unsigned long paddr, maddr; @@ -223,14 +223,7 @@ mspec_fault(struct vm_fault *vmf) pfn = paddr >> PAGE_SHIFT; - /* - * vm_insert_pfn can fail with -EBUSY, but in that case it will - * be because another thread has installed the pte first, so it - * is no problem. - */ - vm_insert_pfn(vmf->vma, vmf->address, pfn); - - return VM_FAULT_NOPAGE; + return vmf_insert_pfn(vmf->vma, vmf->address, pfn); } static const struct vm_operations_struct mspec_vm_ops = { -- cgit v1.2.3-59-g8ed1b