include/linux/hmm.h: Convert to use vm_fault_t
Subsystems (2)
PATCH 1/1 include/linux/hmm.h: Convert to use vm_fault_t
convert to use vm_fault_t type as return type for
fault handler.
--- include/linux/hmm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/hmm.h +1 -1
@@ -468,7 +468,7 @@ struct hmm_devmem_ops {* Note that mmap semaphore is held in read mode at least when this * callback occurs, hence the vma is valid upon callback entry. */ - int (*fault)(struct hmm_devmem *devmem, + vm_fault_t (*fault)(struct hmm_devmem *devmem, struct vm_area_struct *vma, unsigned long addr, const struct page *page,
Signature · 1 line
1.9.1
Quoted 5 lines · Souptick Joarder
convert to use
vm_fault_ttype as return type for
fault handler.Signed-off-by Souptick Joarder <[email protected]>
kbuild reported a warning during testing of final vm_fault_t patch integrated in mm tree.
[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]
Quoted 1 line
Quoted 1 line
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 warning.
Quoted 20 lines
--- include/linux/hmm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/hmm.h +1
-2@@ -468,7 +468,7 @@ struct hmm_devmem_ops {* Note that mmap semaphore is held in read mode at least when this * callback occurs, hence the vma is valid upon callback entry. */ - int (*fault)(struct hmm_devmem *devmem, + vm_fault_t (*fault)(struct hmm_devmem *devmem, struct vm_area_struct *vma, unsigned long addr, const struct page *page, --1.9.1
Quoted 2 lines · Souptick Joarder
convert to use
vm_fault_ttype as return type for
fault handler.
I think you'll also need to convert hmm_devmem_fault(). And that's going to lead to some more spots.
(It's important to note that this is the patch working as designed. It's throwing up warnings where code *hasn't* been converted to vm_fault_t yet but should have been).
Quoted 7 lines · Matthew Wilcox
Quoted 2 lines · Souptick Joarder
convert to use
vm_fault_ttype as return type for
fault handler.I think you'll also need to convert
hmm_devmem_fault(). And that's going to lead to some more spots.
I will add it in v2.
Quoted 4 lines
(It's important to note that this is the patch working as designed. It's throwing up warnings where code *hasn't* been converted to
vm_fault_tyet but should have been).
Ok.