diff mbox series

[-next] scsi: libsas: simplify the return expression of sas_discover_end_dev

Message ID 20200921082453.2592137-1-liushixin2@huawei.com
State New
Headers show
Series [-next] scsi: libsas: simplify the return expression of sas_discover_end_dev | expand

Commit Message

Liu Shixin Sept. 21, 2020, 8:24 a.m. UTC
Simplify the return expression.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 drivers/scsi/libsas/sas_discover.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

John Garry Sept. 21, 2020, 1:03 p.m. UTC | #1
On 21/09/2020 09:24, Liu Shixin wrote:
> Simplify the return expression.
> 
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
> ---
>   drivers/scsi/libsas/sas_discover.c | 8 +-------
>   1 file changed, 1 insertion(+), 7 deletions(-)
> 
> 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 ---------- */
> 

You can make a similar change at the end of sas_discover_data() [and 
include in the same patch]
diff mbox series

Patch

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 ---------- */