From fa60a31b0cf07794d643924328cd7e3a78e99aca Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Sun, 22 Oct 2017 15:15:33 -0700 Subject: scsi: csiostor: Convert timers to use timer_setup() In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: "Martin K. Petersen" Cc: "James E.J. Bottomley" Cc: Varun Prakash Cc: Johannes Thumshirn Cc: linux-scsi@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Martin K. Petersen --- drivers/scsi/csiostor/csio_hw.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'drivers/scsi/csiostor/csio_hw.c') diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c index 5be0086142ca..0bd1131b6cc9 100644 --- a/drivers/scsi/csiostor/csio_hw.c +++ b/drivers/scsi/csiostor/csio_hw.c @@ -3347,9 +3347,10 @@ csio_mberr_worker(void *data) * **/ static void -csio_hw_mb_timer(uintptr_t data) +csio_hw_mb_timer(struct timer_list *t) { - struct csio_hw *hw = (struct csio_hw *)data; + struct csio_mbm *mbm = from_timer(mbm, t, timer); + struct csio_hw *hw = mbm->hw; struct csio_mb *mbp = NULL; spin_lock_irq(&hw->lock); @@ -3715,9 +3716,9 @@ csio_mgmt_req_lookup(struct csio_mgmtm *mgmtm, struct csio_ioreq *io_req) * Return - none. */ static void -csio_mgmt_tmo_handler(uintptr_t data) +csio_mgmt_tmo_handler(struct timer_list *t) { - struct csio_mgmtm *mgmtm = (struct csio_mgmtm *) data; + struct csio_mgmtm *mgmtm = from_timer(mgmtm, t, mgmt_timer); struct list_head *tmp; struct csio_ioreq *io_req; @@ -3797,11 +3798,7 @@ csio_mgmtm_cleanup(struct csio_mgmtm *mgmtm) static int csio_mgmtm_init(struct csio_mgmtm *mgmtm, struct csio_hw *hw) { - struct timer_list *timer = &mgmtm->mgmt_timer; - - init_timer(timer); - timer->function = csio_mgmt_tmo_handler; - timer->data = (unsigned long)mgmtm; + timer_setup(&mgmtm->mgmt_timer, csio_mgmt_tmo_handler, 0); INIT_LIST_HEAD(&mgmtm->active_q); INIT_LIST_HEAD(&mgmtm->cbfn_q); -- cgit