]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: lpfc: Use secs_to_jiffies() instead of msecs_to_jiffies()
authorThorsten Blum <thorsten.blum@linux.dev>
Mon, 28 Apr 2025 17:16:26 +0000 (19:16 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 29 Apr 2025 01:28:36 +0000 (21:28 -0400)
Use secs_to_jiffies() instead of msecs_to_jiffies() and avoid scaling the
timeouts to milliseconds.

No functional changes intended.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://lore.kernel.org/r/20250428171625.2499-2-thorsten.blum@linux.dev
Reviewed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_bsg.c
drivers/scsi/lpfc/lpfc_vport.c

index c8f8496bbdf8eac8c0d0a7e4b183b958cfc4fdb0..d61d979f9b774fd5f15c36e3bc669ec29a1ed643 100644 (file)
@@ -2687,8 +2687,7 @@ static int lpfcdiag_loop_get_xri(struct lpfc_hba *phba, uint16_t rpi,
        evt->wait_time_stamp = jiffies;
        time_left = wait_event_interruptible_timeout(
                evt->wq, !list_empty(&evt->events_to_see),
-               msecs_to_jiffies(1000 *
-                       ((phba->fc_ratov * 2) + LPFC_DRVR_TIMEOUT)));
+               secs_to_jiffies(phba->fc_ratov * 2 + LPFC_DRVR_TIMEOUT));
        if (list_empty(&evt->events_to_see))
                ret_val = (time_left) ? -EINTR : -ETIMEDOUT;
        else {
@@ -3258,8 +3257,7 @@ lpfc_bsg_diag_loopback_run(struct bsg_job *job)
        evt->waiting = 1;
        time_left = wait_event_interruptible_timeout(
                evt->wq, !list_empty(&evt->events_to_see),
-               msecs_to_jiffies(1000 *
-                       ((phba->fc_ratov * 2) + LPFC_DRVR_TIMEOUT)));
+               secs_to_jiffies(phba->fc_ratov * 2 + LPFC_DRVR_TIMEOUT));
        evt->waiting = 0;
        if (list_empty(&evt->events_to_see)) {
                rc = (time_left) ? -EINTR : -ETIMEDOUT;
index cc56a73343195a263c307fab6870a0012899060a..2797aa75a689e84c0914fb1dfa7fda25d109857f 100644 (file)
@@ -505,7 +505,7 @@ lpfc_send_npiv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
                wait_event_timeout(waitq,
                                   !test_bit(NLP_WAIT_FOR_LOGO,
                                             &ndlp->save_flags),
-                                  msecs_to_jiffies(phba->fc_ratov * 2000));
+                                  secs_to_jiffies(phba->fc_ratov * 2));
 
                if (!test_bit(NLP_WAIT_FOR_LOGO, &ndlp->save_flags))
                        goto logo_cmpl;
@@ -703,7 +703,7 @@ lpfc_vport_delete(struct fc_vport *fc_vport)
                                wait_event_timeout(waitq,
                                   !test_bit(NLP_WAIT_FOR_DA_ID,
                                             &ndlp->save_flags),
-                                  msecs_to_jiffies(phba->fc_ratov * 2000));
+                                  secs_to_jiffies(phba->fc_ratov * 2));
                        }
 
                        lpfc_printf_vlog(vport, KERN_INFO, LOG_VPORT | LOG_ELS,