From af90fa6a94276aed879ebbf230cb9cd304e08c9e Mon Sep 17 00:00:00 2001 From: Florian Pose Date: Fri, 3 Apr 2020 12:00:24 +0200 Subject: [PATCH] New page fault return type vm_fault_t since 4.17. --- master/cdev.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/master/cdev.c b/master/cdev.c index 70dc4b99..5bba2be0 100644 --- a/master/cdev.c +++ b/master/cdev.c @@ -1,8 +1,6 @@ /****************************************************************************** * - * $Id$ - * - * Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH + * Copyright (C) 2006-2020 Florian Pose, Ingenieurgemeinschaft IgH * * This file is part of the IgH EtherCAT Master. * @@ -61,8 +59,14 @@ static int eccdev_mmap(struct file *, struct vm_area_struct *); */ #define PAGE_FAULT_VERSION KERNEL_VERSION(2, 6, 23) +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) +# define FAULT_RETURN_TYPE int +#else +# define FAULT_RETURN_TYPE vm_fault_t +#endif + #if LINUX_VERSION_CODE >= PAGE_FAULT_VERSION -static int eccdev_vma_fault( +static FAULT_RETURN_TYPE eccdev_vma_fault( #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) struct vm_area_struct *, #endif @@ -256,7 +260,7 @@ int eccdev_mmap( * * \return Zero on success, otherwise a negative error code. */ -static int eccdev_vma_fault( +static FAULT_RETURN_TYPE eccdev_vma_fault( #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) struct vm_area_struct *vma, /**< Virtual memory area. */ #endif