New page fault return type vm_fault_t since 4.17.

This commit is contained in:
Florian Pose 2020-04-03 12:00:24 +02:00
parent 580ede82df
commit af90fa6a94
1 changed files with 9 additions and 5 deletions

View File

@ -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