diff options
author | Dustin Brown <dustinb@codeaurora.org> | 2017-08-17 16:28:52 -0700 |
---|---|---|
committer | snandini <snandini@codeaurora.org> | 2017-09-08 01:57:46 -0700 |
commit | 8f6788d071cf3460d5ba8f7dabd1bd8beef99f66 (patch) | |
tree | e1eb8ca8363bd0876b30e2f5bc8534105fbbfa5d /utils | |
parent | 23f532b8872be3b529702b6f9c545b2bec18fb54 (diff) | |
download | qca-wfi-host-cmn-8f6788d071cf3460d5ba8f7dabd1bd8beef99f66.tar.gz |
qcacmn: Use vm_fault->address instead of virtual_address
Linux kernel 4.10 removed vm_fault->virtual_address in favor of simply
using vm_fault->address. Add conditional compilation to use the
appropriate vm_fault address field based on the version of the Linux
kernel being compiled against.
Change-Id: I3f29721888bf349a7ac4f5f62d576b668ee0abc2
CRs-Fixed: 2094806
Diffstat (limited to 'utils')
-rw-r--r-- | utils/pktlog/linux_ac.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/utils/pktlog/linux_ac.c b/utils/pktlog/linux_ac.c index e16142a30..7e0aab5d5 100644 --- a/utils/pktlog/linux_ac.c +++ b/utils/pktlog/linux_ac.c @@ -991,9 +991,21 @@ static void pktlog_vclose(struct vm_area_struct *vma) PKTLOG_MOD_DEC_USE_COUNT; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) +static inline unsigned long pktlog_get_fault_address(struct vm_fault *vmf) +{ + return (unsigned long)vmf->virtual_address; +} +#else +static inline unsigned long pktlog_get_fault_address(struct vm_fault *vmf) +{ + return vmf->address; +} +#endif /* KERNEL_VERSION(4, 10, 0) */ + static int pktlog_fault(struct vm_area_struct *vma, struct vm_fault *vmf) { - unsigned long address = (unsigned long)vmf->virtual_address; + unsigned long address = pktlog_get_fault_address(vmf); if (address == 0UL) return VM_FAULT_NOPAGE; |