summaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@wdc.com>2018-06-22 14:52:57 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2018-07-02 16:44:31 -0400
commita8864d861d62feadc5f37c6651a7d7a2fc2477a8 (patch)
tree5d8ae3821a052919e9f0f7db2cd9158370a2cb5d /drivers/target
parent65422d705f1abf65897464b4e9c51ec3e1376ec4 (diff)
downloadblackbird-op-linux-a8864d861d62feadc5f37c6651a7d7a2fc2477a8.tar.gz
blackbird-op-linux-a8864d861d62feadc5f37c6651a7d7a2fc2477a8.zip
scsi: target: Simplify transport_generic_free_cmd() (1/2)
Move identical code outside an if/else statement. This patch does not change any functionality. Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com> Reviewed-by: Mike Christie <mchristi@redhat.com> Cc: Hannes Reinecke <hare@suse.com> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_transport.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 3f95ddea6b1c..65995532d02b 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -2664,9 +2664,6 @@ int transport_generic_free_cmd(struct se_cmd *cmd, int wait_for_tasks)
if (!(cmd->se_cmd_flags & SCF_SE_LUN_CMD)) {
if (wait_for_tasks && (cmd->se_cmd_flags & SCF_SCSI_TMR_CDB))
target_wait_free_cmd(cmd, &aborted, &tas);
-
- if (!aborted || tas)
- ret = target_put_sess_cmd(cmd);
} else {
if (wait_for_tasks)
target_wait_free_cmd(cmd, &aborted, &tas);
@@ -2680,10 +2677,9 @@ int transport_generic_free_cmd(struct se_cmd *cmd, int wait_for_tasks)
if (cmd->se_lun)
transport_lun_remove_cmd(cmd);
-
- if (!aborted || tas)
- ret = target_put_sess_cmd(cmd);
}
+ if (!aborted || tas)
+ ret = target_put_sess_cmd(cmd);
if (aborted) {
pr_debug("Detected CMD_T_ABORTED for ITT: %llu\n", cmd->tag);
wait_for_completion(&cmd->cmd_wait_comp);
OpenPOWER on IntegriCloud