]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:46:01 +0000 (11:46 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 10:19:03 +0000 (11:19 +0100)
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 <namcao@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://lore.kernel.org/all/c951a5966e134307b8e50afb08e4b742e3f6ad06.1738746904.git.namcao@linutronix.de
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/scsi_debug.c

index 16d085d56e9d7d3bf890cc93d72bdae70fa6e9e7..9e42230e42b86260e79f9d0be995afda1117e0a9 100644 (file)
@@ -2922,9 +2922,7 @@ static long ibmvscsis_alloctimer(struct scsi_info *vscsi)
        struct timer_cb *p_timer;
 
        p_timer = &vscsi->rsp_q_timer;
-       hrtimer_init(&p_timer->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-
-       p_timer->timer.function = ibmvscsis_service_wait_q;
+       hrtimer_setup(&p_timer->timer, ibmvscsis_service_wait_q, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
        p_timer->started = false;
        p_timer->timer_pops = 0;
 
index bcadf11414c8a41d6fc99d03586d55c26d0a6a0f..d1ac1d1cec3c638099c26277f52f67e79a46c4d9 100644 (file)
@@ -7952,11 +7952,10 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
        timer_setup(&phba->fcf.redisc_wait, lpfc_sli4_fcf_redisc_wait_tmo, 0);
 
        /* CMF congestion timer */
-       hrtimer_init(&phba->cmf_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-       phba->cmf_timer.function = lpfc_cmf_timer;
+       hrtimer_setup(&phba->cmf_timer, lpfc_cmf_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
        /* CMF 1 minute stats collection timer */
-       hrtimer_init(&phba->cmf_stats_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-       phba->cmf_stats_timer.function = lpfc_cmf_stats_timer;
+       hrtimer_setup(&phba->cmf_stats_timer, lpfc_cmf_stats_timer, CLOCK_MONOTONIC,
+                     HRTIMER_MODE_REL);
 
        /*
         * Control structure for handling external multi-buffer mailbox
index 5ceaa4665e5df76139cb3607833f99b4985720ad..fe5c30bb263986727b4d943d43a28ee208cb6aae 100644 (file)
@@ -6384,8 +6384,8 @@ static struct sdebug_queued_cmd *sdebug_alloc_queued_cmd(struct scsi_cmnd *scmd)
 
        sd_dp = &sqcp->sd_dp;
 
-       hrtimer_init(&sd_dp->hrt, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED);
-       sd_dp->hrt.function = sdebug_q_cmd_hrt_complete;
+       hrtimer_setup(&sd_dp->hrt, sdebug_q_cmd_hrt_complete, CLOCK_MONOTONIC,
+                     HRTIMER_MODE_REL_PINNED);
        INIT_WORK(&sd_dp->ew.work, sdebug_q_cmd_wq_complete);
 
        sqcp->scmd = scmd;