Commit 7c3d0f15 authored by Souptick Joarder's avatar Souptick Joarder Committed by Gustavo Padovan

drm/vkms: Use new return type vm_fault_t

Use new return type vm_fault_t for fault handler.
Signed-off-by: default avatarSouptick Joarder <jrdr.linux@gmail.com>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180726144549.GA9434@jordon-HP-15-Notebook-PC
parent 27fb462a
...@@ -81,7 +81,7 @@ struct drm_gem_object *vkms_gem_create(struct drm_device *dev, ...@@ -81,7 +81,7 @@ struct drm_gem_object *vkms_gem_create(struct drm_device *dev,
u32 *handle, u32 *handle,
u64 size); u64 size);
int vkms_gem_fault(struct vm_fault *vmf); vm_fault_t vkms_gem_fault(struct vm_fault *vmf);
int vkms_dumb_create(struct drm_file *file, struct drm_device *dev, int vkms_dumb_create(struct drm_file *file, struct drm_device *dev,
struct drm_mode_create_dumb *args); struct drm_mode_create_dumb *args);
......
...@@ -45,14 +45,14 @@ void vkms_gem_free_object(struct drm_gem_object *obj) ...@@ -45,14 +45,14 @@ void vkms_gem_free_object(struct drm_gem_object *obj)
kfree(gem); kfree(gem);
} }
int vkms_gem_fault(struct vm_fault *vmf) vm_fault_t vkms_gem_fault(struct vm_fault *vmf)
{ {
struct vm_area_struct *vma = vmf->vma; struct vm_area_struct *vma = vmf->vma;
struct vkms_gem_object *obj = vma->vm_private_data; struct vkms_gem_object *obj = vma->vm_private_data;
unsigned long vaddr = vmf->address; unsigned long vaddr = vmf->address;
pgoff_t page_offset; pgoff_t page_offset;
loff_t num_pages; loff_t num_pages;
int ret; vm_fault_t ret = VM_FAULT_SIGBUS;
page_offset = (vaddr - vma->vm_start) >> PAGE_SHIFT; page_offset = (vaddr - vma->vm_start) >> PAGE_SHIFT;
num_pages = DIV_ROUND_UP(obj->gem.size, PAGE_SIZE); num_pages = DIV_ROUND_UP(obj->gem.size, PAGE_SIZE);
...@@ -60,7 +60,6 @@ int vkms_gem_fault(struct vm_fault *vmf) ...@@ -60,7 +60,6 @@ int vkms_gem_fault(struct vm_fault *vmf)
if (page_offset > num_pages) if (page_offset > num_pages)
return VM_FAULT_SIGBUS; return VM_FAULT_SIGBUS;
ret = -ENOENT;
mutex_lock(&obj->pages_lock); mutex_lock(&obj->pages_lock);
if (obj->pages) { if (obj->pages) {
get_page(obj->pages[page_offset]); get_page(obj->pages[page_offset]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment