Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: ufs: core: Move code out of an if-statement

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>

authored by

Bart Van Assche and committed by
Martin K. Petersen
b92e5937 72e97922

+13 -19
+13 -19
drivers/ufs/core/ufshcd.c
··· 10356 10356 dev_err(hba->dev, "MCQ mode is disabled, err=%d\n", 10357 10357 err); 10358 10358 } 10359 - err = scsi_add_host(hba->host, hba->dev); 10360 - if (err) { 10361 - dev_err(hba->dev, "scsi_add_host failed\n"); 10362 - return err; 10363 - } 10364 - hba->scsi_host_added = true; 10365 - } else { 10366 - if (!hba->lsdb_sup) { 10367 - dev_err(hba->dev, 10368 - "%s: failed to initialize (legacy doorbell mode not supported)\n", 10369 - __func__); 10370 - return -EINVAL; 10371 - } 10372 - err = scsi_add_host(hba->host, hba->dev); 10373 - if (err) { 10374 - dev_err(hba->dev, "scsi_add_host failed\n"); 10375 - return err; 10376 - } 10377 - hba->scsi_host_added = true; 10378 10359 } 10360 + if (!is_mcq_supported(hba) && !hba->lsdb_sup) { 10361 + dev_err(hba->dev, 10362 + "%s: failed to initialize (legacy doorbell mode not supported)\n", 10363 + __func__); 10364 + return -EINVAL; 10365 + } 10366 + 10367 + err = scsi_add_host(hba->host, hba->dev); 10368 + if (err) { 10369 + dev_err(hba->dev, "scsi_add_host failed\n"); 10370 + return err; 10371 + } 10372 + hba->scsi_host_added = true; 10379 10373 10380 10374 hba->tmf_tag_set = (struct blk_mq_tag_set) { 10381 10375 .nr_hw_queues = 1,