Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpu: drm: drm_vm: Adding new typedef vm_fault_t

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.

commit 1c8f422059ae ("mm: change return type to vm_fault_t")

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180510134203.GA25166@jordon-HP-15-Notebook-PC

authored by

Souptick Joarder and committed by
Daniel Vetter
6c259091 d104328c

+5 -5
+5 -5
drivers/gpu/drm/drm_vm.c
··· 100 100 * map, get the page, increment the use count and return it. 101 101 */ 102 102 #if IS_ENABLED(CONFIG_AGP) 103 - static int drm_vm_fault(struct vm_fault *vmf) 103 + static vm_fault_t drm_vm_fault(struct vm_fault *vmf) 104 104 { 105 105 struct vm_area_struct *vma = vmf->vma; 106 106 struct drm_file *priv = vma->vm_file->private_data; ··· 173 173 return VM_FAULT_SIGBUS; /* Disallow mremap */ 174 174 } 175 175 #else 176 - static int drm_vm_fault(struct vm_fault *vmf) 176 + static vm_fault_t drm_vm_fault(struct vm_fault *vmf) 177 177 { 178 178 return VM_FAULT_SIGBUS; 179 179 } ··· 189 189 * Get the mapping, find the real physical page to map, get the page, and 190 190 * return it. 191 191 */ 192 - static int drm_vm_shm_fault(struct vm_fault *vmf) 192 + static vm_fault_t drm_vm_shm_fault(struct vm_fault *vmf) 193 193 { 194 194 struct vm_area_struct *vma = vmf->vma; 195 195 struct drm_local_map *map = vma->vm_private_data; ··· 291 291 * 292 292 * Determine the page number from the page offset and get it from drm_device_dma::pagelist. 293 293 */ 294 - static int drm_vm_dma_fault(struct vm_fault *vmf) 294 + static vm_fault_t drm_vm_dma_fault(struct vm_fault *vmf) 295 295 { 296 296 struct vm_area_struct *vma = vmf->vma; 297 297 struct drm_file *priv = vma->vm_file->private_data; ··· 326 326 * 327 327 * Determine the map offset from the page offset and get it from drm_sg_mem::pagelist. 328 328 */ 329 - static int drm_vm_sg_fault(struct vm_fault *vmf) 329 + static vm_fault_t drm_vm_sg_fault(struct vm_fault *vmf) 330 330 { 331 331 struct vm_area_struct *vma = vmf->vma; 332 332 struct drm_local_map *map = vma->vm_private_data;