From f0f5c0ae40acdee77142b383d3f19f4cf8991697 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 5 Feb 2018 00:12:07 +0000 Subject: [PATCH] scst: Port DEFINE_TIMER() instances to kernel v4.15 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7361 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 8 ++++++++ scst/src/scst_lib.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index ef697ee1a..526976022 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -24,6 +24,7 @@ #include /* struct request_queue */ #include /* struct scatterlist */ #include /* kmalloc() */ +#include #include #include /* sync_page_range() */ #include /* struct scsi_cmnd */ @@ -703,6 +704,13 @@ struct t10_pi_tuple { } while (0) #endif +/* See also commit 1d27e3e2252b ("timer: Remove expires and data arguments from DEFINE_TIMER") */ +#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) +#endif + /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 3ee33f4bf..501bf9deb 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -15399,7 +15399,7 @@ static int tm_dbg_delayed_cmds_count; static int tm_dbg_passed_cmds_count; static int tm_dbg_state; static int tm_dbg_on_state_passes; -static DEFINE_TIMER(tm_dbg_timer, tm_dbg_timer_fn, 0, 0); +static DEFINE_TIMER(tm_dbg_timer, tm_dbg_timer_fn); static struct scst_tgt_dev *tm_dbg_tgt_dev; static const int tm_dbg_on_state_num_passes[] = { 5, 1, 0x7ffffff };