diff options
author | Bart Van Assche <bvanassche@acm.org> | 2021-10-07 13:28:44 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-10-16 21:29:15 -0400 |
commit | 9e0603656fdf2e5b919adcc06ce11bd748bdb543 (patch) | |
tree | ce3a9fa157fad506d916e7b82755b4a273b19d5f /drivers/scsi/megaraid.c | |
parent | 012f14b269da11f43547b7d859ebdc1016213650 (diff) | |
download | lwn-9e0603656fdf2e5b919adcc06ce11bd748bdb543.tar.gz lwn-9e0603656fdf2e5b919adcc06ce11bd748bdb543.zip |
scsi: megaraid: Call scsi_done() directly
Conditional statements are faster than indirect calls. Hence call
scsi_done() directly.
Link: https://lore.kernel.org/r/20211007202923.2174984-50-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/megaraid.c')
-rw-r--r-- | drivers/scsi/megaraid.c | 21 |
1 files 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); |