summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/cxlflash/ocxl_hw.c
diff options
context:
space:
mode:
authorSouptick Joarder <jrdr.linux@gmail.com>2018-06-20 23:55:07 +0530
committerMartin K. Petersen <martin.petersen@oracle.com>2018-06-21 22:57:39 -0400
commita38b80c5f49c30c3cbd4523bdbde0cc725bb0e63 (patch)
tree0f623b4bad51798ce4e7c88171dfb67930f58068 /drivers/scsi/cxlflash/ocxl_hw.c
parent4ae5e9d159f83392c98c4ed88dfc63f19745be38 (diff)
downloadlinux-a38b80c5f49c30c3cbd4523bdbde0cc725bb0e63.tar.bz2
scsi: cxlflash: Change return type for fault handler
Use new return type vm_fault_t for fault handler. 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. Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t") Previously, VM_FAULT_NOPAGE was returned without verifying return value of vm_insert_pfn. The new inline vmf_insert_pfn() will address this issue by returning correct VM_FAULT_* type from fault handler. Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com> Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/cxlflash/ocxl_hw.c')
-rw-r--r--drivers/scsi/cxlflash/ocxl_hw.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/scsi/cxlflash/ocxl_hw.c b/drivers/scsi/cxlflash/ocxl_hw.c
index 0a95b5f25380..91178ff4d13b 100644
--- a/drivers/scsi/cxlflash/ocxl_hw.c
+++ b/drivers/scsi/cxlflash/ocxl_hw.c
@@ -1158,7 +1158,7 @@ static int afu_release(struct inode *inode, struct file *file)
*
* Return: 0 on success, -errno on failure
*/
-static int ocxlflash_mmap_fault(struct vm_fault *vmf)
+static vm_fault_t ocxlflash_mmap_fault(struct vm_fault *vmf)
{
struct vm_area_struct *vma = vmf->vma;
struct ocxlflash_context *ctx = vma->vm_file->private_data;
@@ -1181,8 +1181,7 @@ static int ocxlflash_mmap_fault(struct vm_fault *vmf)
mmio_area = ctx->psn_phys;
mmio_area += offset;
- vm_insert_pfn(vma, vmf->address, mmio_area >> PAGE_SHIFT);
- return VM_FAULT_NOPAGE;
+ return vmf_insert_pfn(vma, vmf->address, mmio_area >> PAGE_SHIFT);
}
static const struct vm_operations_struct ocxlflash_vmops = {