summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLiu Shixin <liushixin2@huawei.com>2020-09-21 21:45:58 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2020-09-22 20:26:08 -0400
commit3d1a99e2b5400fd32ec647b290340b5ed091d3ae (patch)
tree98f706a03252acf527c4f1bb1fa3a8c4dc6938dd /drivers
parent713a846884ce02e402e184c11473f6a19dce8665 (diff)
downloadlinux-3d1a99e2b5400fd32ec647b290340b5ed091d3ae.tar.bz2
scsi: libsas: Simplify the return expression of sas_discover_* functions
Simplify the return expression. Link: https://lore.kernel.org/r/20200921134558.3478922-1-liushixin2@huawei.com Reviewed-by: Jason Yan <yanaijie@huawei.com> Signed-off-by: Liu Shixin <liushixin2@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/libsas/sas_ata.c8
-rw-r--r--drivers/scsi/libsas/sas_discover.c8
2 files changed, 2 insertions, 14 deletions
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index 8b424c8ab834..6f58ace9a377 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -726,19 +726,13 @@ void sas_resume_sata(struct asd_sas_port *port)
*/
int sas_discover_sata(struct domain_device *dev)
{
- int res;
-
if (dev->dev_type == SAS_SATA_PM)
return -ENODEV;
dev->sata_dev.class = sas_get_ata_command_set(dev);
sas_fill_in_rphy(dev, dev->rphy);
- res = sas_notify_lldd_dev_found(dev);
- if (res)
- return res;
-
- return 0;
+ return sas_notify_lldd_dev_found(dev);
}
static void async_sas_ata_eh(void *data, async_cookie_t cookie)
diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c
index 13ad2b3d314e..0f86a1fc6468 100644
--- a/drivers/scsi/libsas/sas_discover.c
+++ b/drivers/scsi/libsas/sas_discover.c
@@ -278,13 +278,7 @@ static void sas_resume_devices(struct work_struct *work)
*/
int sas_discover_end_dev(struct domain_device *dev)
{
- int res;
-
- res = sas_notify_lldd_dev_found(dev);
- if (res)
- return res;
-
- return 0;
+ return sas_notify_lldd_dev_found(dev);
}
/* ---------- Device registration and unregistration ---------- */