linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] scsi: libsas: simplify the return expression of sas_discover_end_dev
@ 2020-09-21  8:24 Liu Shixin
  2020-09-21 13:03 ` John Garry
  0 siblings, 1 reply; 6+ messages in thread
From: Liu Shixin @ 2020-09-21  8:24 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen
  Cc: linux-scsi, linux-kernel, Liu Shixin

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH -next] scsi: libsas: simplify the return expression of sas_discover_end_dev
  2020-09-21  8:24 [PATCH -next] scsi: libsas: simplify the return expression of sas_discover_end_dev Liu Shixin
@ 2020-09-21 13:03 ` John Garry
  2020-09-21 13:45   ` [PATCH -next] scsi: libsas: simplify the return expression of sas_discover_* functions Liu Shixin
  0 siblings, 1 reply; 6+ messages in thread
From: John Garry @ 2020-09-21 13:03 UTC (permalink / raw)
  To: Liu Shixin, James E.J. Bottomley, Martin K. Petersen
  Cc: linux-scsi, linux-kernel

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]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH -next] scsi: libsas: simplify the return expression of sas_discover_* functions
  2020-09-21 13:03 ` John Garry
@ 2020-09-21 13:45   ` Liu Shixin
  2020-09-21 13:46     ` Jason Yan
                       ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Liu Shixin @ 2020-09-21 13:45 UTC (permalink / raw)
  To: John Garry, James E.J. Bottomley, Martin K. Petersen
  Cc: linux-scsi, linux-kernel, Liu Shixin

Simplify the return expression.

Signed-off-by: Liu Shixin <liushixin2@huawei.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 ---------- */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH -next] scsi: libsas: simplify the return expression of sas_discover_* functions
  2020-09-21 13:45   ` [PATCH -next] scsi: libsas: simplify the return expression of sas_discover_* functions Liu Shixin
@ 2020-09-21 13:46     ` Jason Yan
  2020-09-23  0:30     ` Martin K. Petersen
  2020-09-30  3:34     ` Martin K. Petersen
  2 siblings, 0 replies; 6+ messages in thread
From: Jason Yan @ 2020-09-21 13:46 UTC (permalink / raw)
  To: Liu Shixin, John Garry, James E.J. Bottomley, Martin K. Petersen
  Cc: linux-scsi, linux-kernel


在 2020/9/21 21:45, Liu Shixin 写道:
> Simplify the return expression.
> 
> Signed-off-by: Liu Shixin <liushixin2@huawei.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@huawei.com>

Thanks,
Jason

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH -next] scsi: libsas: simplify the return expression of sas_discover_* functions
  2020-09-21 13:45   ` [PATCH -next] scsi: libsas: simplify the return expression of sas_discover_* functions Liu Shixin
  2020-09-21 13:46     ` Jason Yan
@ 2020-09-23  0:30     ` Martin K. Petersen
  2020-09-30  3:34     ` Martin K. Petersen
  2 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2020-09-23  0:30 UTC (permalink / raw)
  To: Liu Shixin
  Cc: John Garry, James E.J. Bottomley, Martin K. Petersen, linux-scsi,
	linux-kernel


Liu,

> Simplify the return expression.

Applied to 5.10/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH -next] scsi: libsas: simplify the return expression of sas_discover_* functions
  2020-09-21 13:45   ` [PATCH -next] scsi: libsas: simplify the return expression of sas_discover_* functions Liu Shixin
  2020-09-21 13:46     ` Jason Yan
  2020-09-23  0:30     ` Martin K. Petersen
@ 2020-09-30  3:34     ` Martin K. Petersen
  2 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2020-09-30  3:34 UTC (permalink / raw)
  To: Liu Shixin, John Garry, James E.J. Bottomley
  Cc: Martin K . Petersen, linux-scsi, linux-kernel

On Mon, 21 Sep 2020 21:45:58 +0800, Liu Shixin wrote:

> Simplify the return expression.

Applied to 5.10/scsi-queue, thanks!

[1/1] scsi: libsas: Simplify the return expression of sas_discover_* functions
      https://git.kernel.org/mkp/scsi/c/3d1a99e2b540

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-09-30  3:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-21  8:24 [PATCH -next] scsi: libsas: simplify the return expression of sas_discover_end_dev Liu Shixin
2020-09-21 13:03 ` John Garry
2020-09-21 13:45   ` [PATCH -next] scsi: libsas: simplify the return expression of sas_discover_* functions Liu Shixin
2020-09-21 13:46     ` Jason Yan
2020-09-23  0:30     ` Martin K. Petersen
2020-09-30  3:34     ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).