From a1b4c9e2fc839fe5e2f4358ed329b6e3be2efb2f Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 4 Mar 2018 19:38:02 +0000 Subject: [PATCH] scst_lib: Port task management debug code to kernel v4.15 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7385 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 4 +++- scst/src/scst_lib.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index 526976022..0576e0226 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -708,7 +708,9 @@ struct t10_pi_tuple { #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) #undef DEFINE_TIMER #define DEFINE_TIMER(_name, _function) \ - struct timer_list _name = __TIMER_INITIALIZER(_function, 0, 0, 0) + struct timer_list _name = __TIMER_INITIALIZER( \ + (void (*)(unsigned long))(_function), \ + (unsigned long)&(_name), 0, 0) #endif /* */ diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 284195d72..ff241e2b9 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -15368,7 +15368,7 @@ EXPORT_SYMBOL_GPL(scst_random); #define INIT_TM_DBG_STATE TM_DBG_STATE_ABORT -static void tm_dbg_timer_fn(unsigned long arg); +static void tm_dbg_timer_fn(struct timer_list *timer); static DEFINE_SPINLOCK(scst_tm_dbg_lock); /* All serialized by scst_tm_dbg_lock */ @@ -15422,7 +15422,7 @@ static void tm_dbg_deinit_tgt_dev(struct scst_tgt_dev *tgt_dev) return; } -static void tm_dbg_timer_fn(unsigned long arg) +static void tm_dbg_timer_fn(struct timer_list *timer) { TRACE_MGMT_DBG("%s", "delayed cmd timer expired"); tm_dbg_flags.tm_dbg_release = 1;