Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: ipr: 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: Brian King <brking@us.ibm.com>
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>

+15 -15
+15 -15
drivers/scsi/ipr.c
··· 694 694 ipr_cmd->sibling = NULL; 695 695 ipr_cmd->eh_comp = NULL; 696 696 ipr_cmd->fast_done = fast_done; 697 - init_timer(&ipr_cmd->timer); 697 + timer_setup(&ipr_cmd->timer, NULL, 0); 698 698 } 699 699 700 700 /** ··· 990 990 **/ 991 991 static void ipr_do_req(struct ipr_cmnd *ipr_cmd, 992 992 void (*done) (struct ipr_cmnd *), 993 - void (*timeout_func) (struct ipr_cmnd *), u32 timeout) 993 + void (*timeout_func) (struct timer_list *), u32 timeout) 994 994 { 995 995 list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_pending_q); 996 996 997 997 ipr_cmd->done = done; 998 998 999 - ipr_cmd->timer.data = (unsigned long) ipr_cmd; 1000 999 ipr_cmd->timer.expires = jiffies + timeout; 1001 - ipr_cmd->timer.function = (void (*)(unsigned long))timeout_func; 1000 + ipr_cmd->timer.function = (TIMER_FUNC_TYPE)timeout_func; 1002 1001 1003 1002 add_timer(&ipr_cmd->timer); 1004 1003 ··· 1079 1080 * none 1080 1081 **/ 1081 1082 static void ipr_send_blocking_cmd(struct ipr_cmnd *ipr_cmd, 1082 - void (*timeout_func) (struct ipr_cmnd *ipr_cmd), 1083 + void (*timeout_func) (struct timer_list *), 1083 1084 u32 timeout) 1084 1085 { 1085 1086 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; ··· 2663 2664 * Return value: 2664 2665 * none 2665 2666 **/ 2666 - static void ipr_timeout(struct ipr_cmnd *ipr_cmd) 2667 + static void ipr_timeout(struct timer_list *t) 2667 2668 { 2669 + struct ipr_cmnd *ipr_cmd = from_timer(ipr_cmd, t, timer); 2668 2670 unsigned long lock_flags = 0; 2669 2671 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; 2670 2672 ··· 2696 2696 * Return value: 2697 2697 * none 2698 2698 **/ 2699 - static void ipr_oper_timeout(struct ipr_cmnd *ipr_cmd) 2699 + static void ipr_oper_timeout(struct timer_list *t) 2700 2700 { 2701 + struct ipr_cmnd *ipr_cmd = from_timer(ipr_cmd, t, timer); 2701 2702 unsigned long lock_flags = 0; 2702 2703 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; 2703 2704 ··· 5450 5449 * Return value: 5451 5450 * none 5452 5451 **/ 5453 - static void ipr_abort_timeout(struct ipr_cmnd *ipr_cmd) 5452 + static void ipr_abort_timeout(struct timer_list *t) 5454 5453 { 5454 + struct ipr_cmnd *ipr_cmd = from_timer(ipr_cmd, t, timer); 5455 5455 struct ipr_cmnd *reset_cmd; 5456 5456 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; 5457 5457 struct ipr_cmd_pkt *cmd_pkt; ··· 8273 8271 * Return value: 8274 8272 * none 8275 8273 **/ 8276 - static void ipr_reset_timer_done(struct ipr_cmnd *ipr_cmd) 8274 + static void ipr_reset_timer_done(struct timer_list *t) 8277 8275 { 8276 + struct ipr_cmnd *ipr_cmd = from_timer(ipr_cmd, t, timer); 8278 8277 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; 8279 8278 unsigned long lock_flags = 0; 8280 8279 ··· 8311 8308 list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_pending_q); 8312 8309 ipr_cmd->done = ipr_reset_ioa_job; 8313 8310 8314 - ipr_cmd->timer.data = (unsigned long) ipr_cmd; 8315 8311 ipr_cmd->timer.expires = jiffies + timeout; 8316 - ipr_cmd->timer.function = (void (*)(unsigned long))ipr_reset_timer_done; 8312 + ipr_cmd->timer.function = (TIMER_FUNC_TYPE)ipr_reset_timer_done; 8317 8313 add_timer(&ipr_cmd->timer); 8318 8314 } 8319 8315 ··· 8396 8394 } 8397 8395 } 8398 8396 8399 - ipr_cmd->timer.data = (unsigned long) ipr_cmd; 8400 8397 ipr_cmd->timer.expires = jiffies + stage_time * HZ; 8401 - ipr_cmd->timer.function = (void (*)(unsigned long))ipr_oper_timeout; 8398 + ipr_cmd->timer.function = (TIMER_FUNC_TYPE)ipr_oper_timeout; 8402 8399 ipr_cmd->done = ipr_reset_ioa_job; 8403 8400 add_timer(&ipr_cmd->timer); 8404 8401 ··· 8467 8466 return IPR_RC_JOB_CONTINUE; 8468 8467 } 8469 8468 8470 - ipr_cmd->timer.data = (unsigned long) ipr_cmd; 8471 8469 ipr_cmd->timer.expires = jiffies + (ioa_cfg->transop_timeout * HZ); 8472 - ipr_cmd->timer.function = (void (*)(unsigned long))ipr_oper_timeout; 8470 + ipr_cmd->timer.function = (TIMER_FUNC_TYPE)ipr_oper_timeout; 8473 8471 ipr_cmd->done = ipr_reset_ioa_job; 8474 8472 add_timer(&ipr_cmd->timer); 8475 8473 list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_pending_q);