Skip to content

Commit 8739e49

Browse files
Souptick Joardersfrothwell
authored andcommitted
mm/hmm: convert to use vm_fault_t
convert to use vm_fault_t type as return type for fault handler. kbuild reported warning during testing of *mm-create-the-new-vm_fault_t-type.patch* available in below link - https://patchwork.kernel.org/patch/10752741/ [auto build test WARNING on linus/master] [also build test WARNING on v5.0-rc1 next-20190109] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] kernel/memremap.c:46:34: warning: incorrect type in return expression (different base types) kernel/memremap.c:46:34: expected restricted vm_fault_t kernel/memremap.c:46:34: got int This patch has fixed the warnings and also hmm_devmem_fault() is converted to return vm_fault_t to avoid further warnings. Link: http://lkml.kernel.org/r/20190110145900.GA1317@jordon-HP-15-Notebook-PC Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com> Reviewed-by: Jérôme Glisse <jglisse@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
1 parent 8f9a99a commit 8739e49

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/linux/hmm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ struct hmm_devmem_ops {
468468
* Note that mmap semaphore is held in read mode at least when this
469469
* callback occurs, hence the vma is valid upon callback entry.
470470
*/
471-
int (*fault)(struct hmm_devmem *devmem,
471+
vm_fault_t (*fault)(struct hmm_devmem *devmem,
472472
struct vm_area_struct *vma,
473473
unsigned long addr,
474474
const struct page *page,
@@ -511,7 +511,7 @@ struct hmm_devmem_ops {
511511
* chunk, as an optimization. It must, however, prioritize the faulting address
512512
* over all the others.
513513
*/
514-
typedef int (*dev_page_fault_t)(struct vm_area_struct *vma,
514+
typedef vm_fault_t (*dev_page_fault_t)(struct vm_area_struct *vma,
515515
unsigned long addr,
516516
const struct page *page,
517517
unsigned int flags,

mm/hmm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ static void hmm_devmem_ref_kill(struct percpu_ref *ref)
990990
percpu_ref_kill(ref);
991991
}
992992

993-
static int hmm_devmem_fault(struct vm_area_struct *vma,
993+
static vm_fault_t hmm_devmem_fault(struct vm_area_struct *vma,
994994
unsigned long addr,
995995
const struct page *page,
996996
unsigned int flags,

0 commit comments

Comments
 (0)