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
This commit is contained in:
Bart Van Assche
2018-02-05 00:12:07 +00:00
parent 86121f3ee4
commit f0f5c0ae40
2 changed files with 9 additions and 1 deletions

View File

@@ -24,6 +24,7 @@
#include <linux/blkdev.h> /* struct request_queue */
#include <linux/scatterlist.h> /* struct scatterlist */
#include <linux/slab.h> /* kmalloc() */
#include <linux/timer.h>
#include <linux/version.h>
#include <linux/writeback.h> /* sync_page_range() */
#include <scsi/scsi_cmnd.h> /* 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
/* <linux/types.h> */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)

View File

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