scsi: libiscsi: Call scsi_done() directly
authorBart Van Assche <bvanassche@acm.org>
Thu, 7 Oct 2021 20:28:39 +0000 (13:28 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 17 Oct 2021 01:28:48 +0000 (21:28 -0400)
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.

Link: https://lore.kernel.org/r/20211007202923.2174984-45-bvanassche@acm.org
Reviewed-by: Lee Duncan <lduncanb@suse.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libiscsi.c

index 54dd9f5..284b939 100644 (file)
@@ -468,7 +468,7 @@ static void iscsi_free_task(struct iscsi_task *task)
                 * it will decide how to return sc to scsi-ml.
                 */
                if (oldstate != ISCSI_TASK_REQUEUE_SCSIQ)
-                       sc->scsi_done(sc);
+                       scsi_done(sc);
        }
 }
 
@@ -1807,7 +1807,7 @@ fault:
        ISCSI_DBG_SESSION(session, "iscsi: cmd 0x%x is not queued (%d)\n",
                          sc->cmnd[0], reason);
        scsi_set_resid(sc, scsi_bufflen(sc));
-       sc->scsi_done(sc);
+       scsi_done(sc);
        return 0;
 }
 EXPORT_SYMBOL_GPL(iscsi_queuecommand);