From 4ff1c130d34d08212113241ed395019805001892 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Thu, 17 Aug 2017 16:57:01 -0700 Subject: [PATCH] qcacmn: Remove vma from vm_operations_struct->fault handler Linux kernel 4.10 removes the vm_area_struct parameter from the vm_operations_struct->fault handler. Add conditional compilation to provided the appropriate fault handler signature based on the version of the Linux kernel being compiled against. Change-Id: I467f4d8426ecfa55e4f2aac26a5326901239a752 CRs-Fixed: 2094824 --- utils/pktlog/linux_ac.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/utils/pktlog/linux_ac.c b/utils/pktlog/linux_ac.c index 7e0aab5d58..5f7af30610 100644 --- a/utils/pktlog/linux_ac.c +++ b/utils/pktlog/linux_ac.c @@ -1003,7 +1003,8 @@ static inline unsigned long pktlog_get_fault_address(struct vm_fault *vmf) } #endif /* KERNEL_VERSION(4, 10, 0) */ -static int pktlog_fault(struct vm_area_struct *vma, struct vm_fault *vmf) +static int +pktlog_fault_handler(struct vm_area_struct *vma, struct vm_fault *vmf) { unsigned long address = pktlog_get_fault_address(vmf); @@ -1018,8 +1019,20 @@ static int pktlog_fault(struct vm_area_struct *vma, struct vm_fault *vmf) return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) +static int pktlog_fault(struct vm_area_struct *vma, struct vm_fault *vmf) +{ + return pktlog_fault_handler(vma, vmf); +} +#else +static int pktlog_fault(struct vm_fault *vmf) +{ + return pktlog_fault_handler(vmf->vma, vmf); +} +#endif + static struct vm_operations_struct pktlog_vmops = { - open: pktlog_vopen, + open: pktlog_vopen, close:pktlog_vclose, fault:pktlog_fault, };