From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
Sathya Prakash Veerichetty <sathya.prakash@broadcom.com>,
Kashyap Desai <kashyap.desai@broadcom.com>,
Sumit Saxena <sumit.saxena@broadcom.com>,
Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>
Subject: [PATCH v2 51/84] mpi3mr: Call scsi_done() directly
Date: Wed, 29 Sep 2021 15:05:27 -0700 [thread overview]
Message-ID: <20210929220600.3509089-52-bvanassche@acm.org> (raw)
In-Reply-To: <20210929220600.3509089-1-bvanassche@acm.org>
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
drivers/scsi/mpi3mr/mpi3mr_os.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 2197988333fe..6373a877f439 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -409,7 +409,7 @@ static bool mpi3mr_flush_scmd(struct request *rq,
scsi_dma_unmap(scmd);
scmd->result = DID_RESET << 16;
scsi_print_command(scmd);
- scmd->scsi_done(scmd);
+ scsi_done(scmd);
mrioc->flush_io_count++;
}
@@ -2312,7 +2312,7 @@ void mpi3mr_process_op_reply_desc(struct mpi3mr_ioc *mrioc,
}
mpi3mr_clear_scmd_priv(mrioc, scmd);
scsi_dma_unmap(scmd);
- scmd->scsi_done(scmd);
+ scsi_done(scmd);
out:
if (sense_buf)
mpi3mr_repost_sense_buf(mrioc,
@@ -3322,7 +3322,7 @@ static bool mpi3mr_check_return_unmap(struct mpi3mr_ioc *mrioc,
__func__);
scsi_print_command(scmd);
scmd->result = DID_OK << 16;
- scmd->scsi_done(scmd);
+ scsi_done(scmd);
return true;
}
@@ -3334,7 +3334,7 @@ static bool mpi3mr_check_return_unmap(struct mpi3mr_ioc *mrioc,
scmd->result = SAM_STAT_CHECK_CONDITION;
scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST,
0x1A, 0);
- scmd->scsi_done(scmd);
+ scsi_done(scmd);
return true;
}
if (param_len != scsi_bufflen(scmd)) {
@@ -3345,7 +3345,7 @@ static bool mpi3mr_check_return_unmap(struct mpi3mr_ioc *mrioc,
scmd->result = SAM_STAT_CHECK_CONDITION;
scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST,
0x1A, 0);
- scmd->scsi_done(scmd);
+ scsi_done(scmd);
return true;
}
buf = kzalloc(scsi_bufflen(scmd), GFP_ATOMIC);
@@ -3354,7 +3354,7 @@ static bool mpi3mr_check_return_unmap(struct mpi3mr_ioc *mrioc,
scmd->result = SAM_STAT_CHECK_CONDITION;
scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST,
0x55, 0x03);
- scmd->scsi_done(scmd);
+ scsi_done(scmd);
return true;
}
scsi_sg_copy_to_buffer(scmd, buf, scsi_bufflen(scmd));
@@ -3368,7 +3368,7 @@ static bool mpi3mr_check_return_unmap(struct mpi3mr_ioc *mrioc,
scmd->result = SAM_STAT_CHECK_CONDITION;
scsi_build_sense_buffer(0, scmd->sense_buffer, ILLEGAL_REQUEST,
0x26, 0);
- scmd->scsi_done(scmd);
+ scsi_done(scmd);
kfree(buf);
return true;
}
@@ -3438,14 +3438,14 @@ static int mpi3mr_qcmd(struct Scsi_Host *shost,
sdev_priv_data = scmd->device->hostdata;
if (!sdev_priv_data || !sdev_priv_data->tgt_priv_data) {
scmd->result = DID_NO_CONNECT << 16;
- scmd->scsi_done(scmd);
+ scsi_done(scmd);
goto out;
}
if (mrioc->stop_drv_processing &&
!(mpi3mr_allow_scmd_to_fw(scmd))) {
scmd->result = DID_NO_CONNECT << 16;
- scmd->scsi_done(scmd);
+ scsi_done(scmd);
goto out;
}
@@ -3459,19 +3459,19 @@ static int mpi3mr_qcmd(struct Scsi_Host *shost,
dev_handle = stgt_priv_data->dev_handle;
if (dev_handle == MPI3MR_INVALID_DEV_HANDLE) {
scmd->result = DID_NO_CONNECT << 16;
- scmd->scsi_done(scmd);
+ scsi_done(scmd);
goto out;
}
if (stgt_priv_data->dev_removed) {
scmd->result = DID_NO_CONNECT << 16;
- scmd->scsi_done(scmd);
+ scsi_done(scmd);
goto out;
}
if (atomic_read(&stgt_priv_data->block_io)) {
if (mrioc->stop_drv_processing) {
scmd->result = DID_NO_CONNECT << 16;
- scmd->scsi_done(scmd);
+ scsi_done(scmd);
goto out;
}
retval = SCSI_MLQUEUE_DEVICE_BUSY;
@@ -3486,7 +3486,7 @@ static int mpi3mr_qcmd(struct Scsi_Host *shost,
host_tag = mpi3mr_host_tag_for_scmd(mrioc, scmd);
if (host_tag == MPI3MR_HOSTTAG_INVALID) {
scmd->result = DID_ERROR << 16;
- scmd->scsi_done(scmd);
+ scsi_done(scmd);
goto out;
}
next prev parent reply other threads:[~2021-09-29 22:07 UTC|newest]
Thread overview: 105+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-29 22:04 [PATCH v2 00/84] Call scsi_done() directly Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 01/84] scsi: core: Use a member variable to track the SCSI command submitter Bart Van Assche
2021-10-01 15:57 ` Benjamin Block
2021-10-03 21:08 ` Bean Huo
2021-09-29 22:04 ` [PATCH v2 02/84] scsi: core: Rename scsi_mq_done() into scsi_done() and export it Bart Van Assche
2021-10-03 21:10 ` Bean Huo
2021-09-29 22:04 ` [PATCH v2 03/84] ata: Call scsi_done() directly Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 04/84] firewire: sbp2: " Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 05/84] ib_srp: " Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 06/84] message: fusion: " Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 07/84] zfcp_scsi: " Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 08/84] 3w-9xxx: " Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 09/84] 3w-sas: " Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 10/84] 3w-xxxx: " Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 11/84] 53c700: " Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 12/84] BusLogic: " Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 13/84] NCR5380: " Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 14/84] a100u2w: " Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 15/84] aacraid: Introduce aac_scsi_done() Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 16/84] aacraid: Call scsi_done() directly Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 17/84] acornscsi: " Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 18/84] advansys: " Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 19/84] aha152x: " Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 20/84] aha1542: " Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 21/84] aic7xxx: " Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 22/84] arcmsr: " Bart Van Assche
2021-09-29 22:04 ` [PATCH v2 23/84] atp870u: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 24/84] bfa: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 25/84] bnx2fc: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 26/84] csiostor: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 27/84] cxlflash: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 28/84] dc395x: " Bart Van Assche
2021-09-30 10:26 ` Oliver Neukum
2021-09-30 16:04 ` Bart Van Assche
2021-10-04 9:44 ` Oliver Neukum
2021-10-04 16:23 ` Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 29/84] dpt_i2o: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 30/84] esas2r: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 31/84] esp_scsi: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 32/84] fas216: Introduce struct fas216_cmd_priv Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 33/84] fas216: Stop using scsi_cmnd.scsi_done Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 34/84] fdomain: Call scsi_done() directly Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 35/84] fnic: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 36/84] hpsa: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 37/84] hptiop: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 38/84] ibmvscsi: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 39/84] imm: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 40/84] initio: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 41/84] ipr: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 42/84] ips: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 43/84] libfc: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 44/84] libiscsi: " Bart Van Assche
2021-10-05 23:52 ` Lee Duncan
2021-09-29 22:05 ` [PATCH v2 45/84] libsas: " Bart Van Assche
2021-09-30 18:08 ` John Garry
2021-09-30 18:20 ` Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 46/84] lpfc: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 47/84] mac53c94: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 48/84] megaraid: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 49/84] " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 50/84] mesh: " Bart Van Assche
2021-09-29 22:05 ` Bart Van Assche [this message]
2021-09-29 22:05 ` [PATCH v2 52/84] mpt3sas: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 53/84] mvumi: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 54/84] myrb: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 55/84] myrs: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 56/84] ncr53c8xx: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 57/84] nsp32: " Bart Van Assche
2021-10-04 4:15 ` Masanori Goto
2021-10-04 16:28 ` Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 58/84] pcmcia: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 59/84] pmcraid: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 60/84] ppa: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 61/84] ps3rom: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 62/84] qedf: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 63/84] qla1280: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 64/84] qla2xxx: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 65/84] qla4xxx: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 66/84] qlogicfas408: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 67/84] qlogicpti: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 68/84] scsi_debug: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 69/84] smartpqi: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 70/84] snic: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 71/84] stex: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 72/84] storvsc_drv: " Bart Van Assche
2021-09-30 17:57 ` Haiyang Zhang
2021-10-06 12:00 ` Wei Liu
2021-10-06 22:11 ` Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 73/84] sym53c8xx_2: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 74/84] ufs: " Bart Van Assche
2021-10-03 21:10 ` Bean Huo
2021-09-29 22:05 ` [PATCH v2 75/84] virtio_scsi: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 76/84] vmw_pvscsi: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 77/84] wd33c93: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 78/84] wd719x: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 79/84] xen-scsifront: " Bart Van Assche
2021-09-29 22:11 ` [PATCH v2 80/84] staging: rts5208: " Bart Van Assche
2021-09-29 22:11 ` [PATCH v2 81/84] staging: unisys: visorhba: " Bart Van Assche
2021-09-30 6:00 ` Greg Kroah-Hartman
2021-09-29 22:11 ` [PATCH v2 82/84] target/tcm_loop: " Bart Van Assche
2021-09-29 22:11 ` [PATCH v2 83/84] usb: " Bart Van Assche
2021-09-29 22:11 ` [PATCH v2 84/84] scsi: core: Call scsi_done directly Bart Van Assche
2021-10-03 21:14 ` Bean Huo
2021-09-30 7:25 ` [PATCH v2 00/84] Call scsi_done() directly Bean Huo
2021-09-30 16:07 ` Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210929220600.3509089-52-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=jejb@linux.ibm.com \
--cc=kashyap.desai@broadcom.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sathya.prakash@broadcom.com \
--cc=sreekanth.reddy@broadcom.com \
--cc=sumit.saxena@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox