diff options
Diffstat (limited to 'recipes-kernel/cryptodev/sdk_patches/0103-zc-Use-the-power-of-elif.patch')
-rw-r--r-- | recipes-kernel/cryptodev/sdk_patches/0103-zc-Use-the-power-of-elif.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/recipes-kernel/cryptodev/sdk_patches/0103-zc-Use-the-power-of-elif.patch b/recipes-kernel/cryptodev/sdk_patches/0103-zc-Use-the-power-of-elif.patch new file mode 100644 index 00000000..5c121077 --- /dev/null +++ b/recipes-kernel/cryptodev/sdk_patches/0103-zc-Use-the-power-of-elif.patch @@ -0,0 +1,51 @@ +From e2fa367d968926500584912e98cf7b17bd9487a6 Mon Sep 17 00:00:00 2001 +From: Phil Sutter <phil@nwl.cc> +Date: Thu, 9 Feb 2017 11:40:46 +0100 +Subject: [PATCH 103/104] zc: Use the power of #elif + +While here, get rid of that trailing newline as well. + +Fixes: 2b29be8ac4141 ("adjust to API changes in kernel >=4.10") +Suggested-by: Frediano Ziglio <freddy77@gmail.com> +Signed-off-by: Phil Sutter <phil@nwl.cc> +--- + zc.c | 11 +++-------- + 1 file changed, 3 insertions(+), 8 deletions(-) + +diff --git a/zc.c b/zc.c +index 2f4ea99..ae464ff 100644 +--- a/zc.c ++++ b/zc.c +@@ -62,21 +62,17 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write, + #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)) + ret = get_user_pages(task, mm, + (unsigned long)addr, pgcount, write, 0, pg, NULL); +-#else +-# if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)) ++#elif (LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)) + ret = get_user_pages_remote(task, mm, + (unsigned long)addr, pgcount, write, 0, pg, NULL); +-# else +-# if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)) ++#elif (LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)) + ret = get_user_pages_remote(task, mm, + (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0, + pg, NULL); +-# else ++#else + ret = get_user_pages_remote(task, mm, + (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0, + pg, NULL, NULL); +-# endif +-# endif + #endif + up_read(&mm->mmap_sem); + if (ret != pgcount) +@@ -222,4 +218,3 @@ int get_userbuf(struct csession *ses, + } + return 0; + } +- +-- +2.10.2 + |