From 1646f6f63093c87bba004b7351bace5fb457ad2c Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 1 Nov 2018 04:23:21 +0000 Subject: [PATCH] scst: Backport timer_setup() to kernel versions before v4.10 git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.3.x@7559 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index d06230ee4..ef697ee1a 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -682,11 +682,19 @@ struct t10_pi_tuple { /* */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) /* * See also commit 686fef928bba ("timer: Prepare to change timer callback - * argument type"). + * argument type"). See also commit 0eeda71bc30d ("timer: Replace timer base + * by a cpu index"). */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0) +#define timer_setup(_timer, _fn, _flags) do { \ + init_timer(_timer); \ + (_timer)->function = (void (*)(unsigned long))(_fn); \ + (_timer)->data = (unsigned long)(_timer); \ + WARN_ON_ONCE((_flags) != 0); \ +} while (0) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0) #define timer_setup(_timer, _fn, _flags) do { \ init_timer(_timer); \ (_timer)->function = (void (*)(unsigned long))(_fn); \