Skip to content

Commit

Permalink
scsi: ufs: core: Move code out of an if-statement
Browse files Browse the repository at this point in the history
The previous patch in this series introduced identical code in both
branches of an if-statement. Move that code outside the if-statement.

Reviewed-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20241016201249.2256266-12-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Bart Van Assche authored and Martin K. Petersen committed Oct 25, 2024
1 parent 72e9792 commit b92e593
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions drivers/ufs/core/ufshcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -10356,26 +10356,20 @@ static int ufshcd_add_scsi_host(struct ufs_hba *hba)
dev_err(hba->dev, "MCQ mode is disabled, err=%d\n",
err);
}
err = scsi_add_host(hba->host, hba->dev);
if (err) {
dev_err(hba->dev, "scsi_add_host failed\n");
return err;
}
hba->scsi_host_added = true;
} else {
if (!hba->lsdb_sup) {
dev_err(hba->dev,
"%s: failed to initialize (legacy doorbell mode not supported)\n",
__func__);
return -EINVAL;
}
err = scsi_add_host(hba->host, hba->dev);
if (err) {
dev_err(hba->dev, "scsi_add_host failed\n");
return err;
}
hba->scsi_host_added = true;
}
if (!is_mcq_supported(hba) && !hba->lsdb_sup) {
dev_err(hba->dev,
"%s: failed to initialize (legacy doorbell mode not supported)\n",
__func__);
return -EINVAL;
}

err = scsi_add_host(hba->host, hba->dev);
if (err) {
dev_err(hba->dev, "scsi_add_host failed\n");
return err;
}
hba->scsi_host_added = true;

hba->tmf_tag_set = (struct blk_mq_tag_set) {
.nr_hw_queues = 1,
Expand Down

0 comments on commit b92e593

Please sign in to comment.