Skip to content

Commit b701192

Browse files
covanamKAGA-KOKO
authored andcommitted
scsi: Switch to use hrtimer_setup()
hrtimer_setup() takes the callback function pointer as argument and initializes the timer completely. Replace hrtimer_init() and the open coded initialization of hrtimer::function with the new setup mechanism. Patch was created by using Coccinelle. Signed-off-by: Nam Cao <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Zack Rusin <[email protected]> Link: https://lore.kernel.org/all/c951a5966e134307b8e50afb08e4b742e3f6ad06.1738746904.git.namcao@linutronix.de
1 parent 0852ca4 commit b701192

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2922,9 +2922,7 @@ static long ibmvscsis_alloctimer(struct scsi_info *vscsi)
29222922
struct timer_cb *p_timer;
29232923

29242924
p_timer = &vscsi->rsp_q_timer;
2925-
hrtimer_init(&p_timer->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
2926-
2927-
p_timer->timer.function = ibmvscsis_service_wait_q;
2925+
hrtimer_setup(&p_timer->timer, ibmvscsis_service_wait_q, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
29282926
p_timer->started = false;
29292927
p_timer->timer_pops = 0;
29302928

drivers/scsi/lpfc/lpfc_init.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7952,11 +7952,10 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
79527952
timer_setup(&phba->fcf.redisc_wait, lpfc_sli4_fcf_redisc_wait_tmo, 0);
79537953

79547954
/* CMF congestion timer */
7955-
hrtimer_init(&phba->cmf_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
7956-
phba->cmf_timer.function = lpfc_cmf_timer;
7955+
hrtimer_setup(&phba->cmf_timer, lpfc_cmf_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
79577956
/* CMF 1 minute stats collection timer */
7958-
hrtimer_init(&phba->cmf_stats_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
7959-
phba->cmf_stats_timer.function = lpfc_cmf_stats_timer;
7957+
hrtimer_setup(&phba->cmf_stats_timer, lpfc_cmf_stats_timer, CLOCK_MONOTONIC,
7958+
HRTIMER_MODE_REL);
79607959

79617960
/*
79627961
* Control structure for handling external multi-buffer mailbox

drivers/scsi/scsi_debug.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6384,8 +6384,8 @@ static struct sdebug_queued_cmd *sdebug_alloc_queued_cmd(struct scsi_cmnd *scmd)
63846384

63856385
sd_dp = &sqcp->sd_dp;
63866386

6387-
hrtimer_init(&sd_dp->hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED);
6388-
sd_dp->hrt.function = sdebug_q_cmd_hrt_complete;
6387+
hrtimer_setup(&sd_dp->hrt, sdebug_q_cmd_hrt_complete, CLOCK_MONOTONIC,
6388+
HRTIMER_MODE_REL_PINNED);
63896389
INIT_WORK(&sd_dp->ew.work, sdebug_q_cmd_wq_complete);
63906390

63916391
sqcp->scmd = scmd;

0 commit comments

Comments
 (0)