public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
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>,
	Kashyap Desai <kashyap.desai@broadcom.com>,
	Sumit Saxena <sumit.saxena@broadcom.com>,
	Shivasharan S <shivasharan.srikanteshwara@broadcom.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>
Subject: [PATCH v2 49/84] megaraid: Call scsi_done() directly
Date: Wed, 29 Sep 2021 15:05:25 -0700	[thread overview]
Message-ID: <20210929220600.3509089-50-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/megaraid.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 56910e94dbf2..c4ea833586e0 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -380,9 +380,6 @@ megaraid_queue_lck(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *))
 
 	adapter = (adapter_t *)scmd->device->host->hostdata;
 
-	scmd->scsi_done = done;
-
-
 	/*
 	 * Allocate and build a SCB request
 	 * busy flag will be set if mega_build_cmd() command could not
@@ -586,7 +583,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy)
 		/* have just LUN 0 for each target on virtual channels */
 		if (cmd->device->lun) {
 			cmd->result = (DID_BAD_TARGET << 16);
-			cmd->scsi_done(cmd);
+			scsi_done(cmd);
 			return NULL;
 		}
 
@@ -605,7 +602,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy)
 
 		if(ldrv_num > max_ldrv_num ) {
 			cmd->result = (DID_BAD_TARGET << 16);
-			cmd->scsi_done(cmd);
+			scsi_done(cmd);
 			return NULL;
 		}
 
@@ -617,7 +614,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy)
 			 * devices
 			 */
 			cmd->result = (DID_BAD_TARGET << 16);
-			cmd->scsi_done(cmd);
+			scsi_done(cmd);
 			return NULL;
 		}
 	}
@@ -637,7 +634,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy)
 			 */
 			if( !adapter->has_cluster ) {
 				cmd->result = (DID_OK << 16);
-				cmd->scsi_done(cmd);
+				scsi_done(cmd);
 				return NULL;
 			}
 
@@ -655,7 +652,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy)
 			return scb;
 #else
 			cmd->result = (DID_OK << 16);
-			cmd->scsi_done(cmd);
+			scsi_done(cmd);
 			return NULL;
 #endif
 
@@ -670,7 +667,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy)
 			kunmap_atomic(buf - sg->offset);
 
 			cmd->result = (DID_OK << 16);
-			cmd->scsi_done(cmd);
+			scsi_done(cmd);
 			return NULL;
 		}
 
@@ -866,7 +863,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy)
 			if( ! adapter->has_cluster ) {
 
 				cmd->result = (DID_BAD_TARGET << 16);
-				cmd->scsi_done(cmd);
+				scsi_done(cmd);
 				return NULL;
 			}
 
@@ -889,7 +886,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy)
 
 		default:
 			cmd->result = (DID_BAD_TARGET << 16);
-			cmd->scsi_done(cmd);
+			scsi_done(cmd);
 			return NULL;
 		}
 	}
@@ -1654,7 +1651,7 @@ mega_rundoneq (adapter_t *adapter)
 		struct scsi_pointer* spos = (struct scsi_pointer *)pos;
 
 		cmd = list_entry(spos, struct scsi_cmnd, SCp);
-		cmd->scsi_done(cmd);
+		scsi_done(cmd);
 	}
 
 	INIT_LIST_HEAD(&adapter->completed_list);

  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 ` Bart Van Assche [this message]
2021-09-29 22:05 ` [PATCH v2 50/84] mesh: " Bart Van Assche
2021-09-29 22:05 ` [PATCH v2 51/84] mpi3mr: " Bart Van Assche
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-50-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=shivasharan.srikanteshwara@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