[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <95502ce3-27aa-0298-21c6-b5ea9d05b478@huawei.com>
Date: Mon, 21 Sep 2020 21:46:31 +0800
From: Jason Yan <yanaijie@...wei.com>
To: Liu Shixin <liushixin2@...wei.com>,
John Garry <john.garry@...wei.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>
CC: <linux-scsi@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] scsi: libsas: simplify the return expression of
sas_discover_* functions
在 2020/9/21 21:45, Liu Shixin 写道:
> Simplify the return expression.
>
> Signed-off-by: Liu Shixin <liushixin2@...wei.com>
> ---
> drivers/scsi/libsas/sas_ata.c | 8 +-------
> drivers/scsi/libsas/sas_discover.c | 8 +-------
> 2 files changed, 2 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
> index a4887985aad6..024e5a550759 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 d0f9e90e3279..161c9b387da7 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 ---------- */
>
Please add a version descriptor and describe the change against the
first version next time . Otherwise this looks good to me.
Reviewed-by: Jason Yan <yanaijie@...wei.com>
Thanks,
Jason
Powered by blists - more mailing lists