public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: qcom: Remove unnecessary goto statement from ufs_qcom_config_esi function
       [not found] <CGME20231219082757epcas1p33bda4e0723d3d57552132054d3e5a3fe@epcas1p3.samsung.com>
@ 2023-12-19  8:27 ` Chanwoo Lee
  2023-12-19 18:05   ` Christophe JAILLET
                     ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chanwoo Lee @ 2023-12-19  8:27 UTC (permalink / raw)
  To: mani, agross, andersson, konrad.dybcio, jejb, martin.petersen,
	linux-arm-msm, linux-scsi, linux-kernel
  Cc: grant.jung, jt77.jang, dh0421.hwang, sh043.lee, ChanWoo Lee

From: ChanWoo Lee <cw9316.lee@samsung.com>

There is only one place where goto is used,
and it is unnecessary to check the ret value through 'goto out'
because the ret value is already true.

Therefore, remove the goto statement and
integrate the '!ret' condition into the existing code.

Signed-off-by: ChanWoo Lee <cw9316.lee@samsung.com>
---
 drivers/ufs/host/ufs-qcom.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index 17e24270477d..8cf803806326 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -1929,7 +1929,7 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
 					     ufs_qcom_write_msi_msg);
 	if (ret) {
 		dev_err(hba->dev, "Failed to request Platform MSI %d\n", ret);
-		goto out;
+		return ret;
 	}
 
 	msi_lock_descs(hba->dev);
@@ -1964,11 +1964,8 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
 				      REG_UFS_CFG3);
 		}
 		ufshcd_mcq_enable_esi(hba);
-	}
-
-out:
-	if (!ret)
 		host->esi_enabled = true;
+	}
 
 	return ret;
 }
-- 
2.29.0


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

* Re: [PATCH] scsi: ufs: qcom: Remove unnecessary goto statement from ufs_qcom_config_esi function
  2023-12-19  8:27 ` [PATCH] scsi: ufs: qcom: Remove unnecessary goto statement from ufs_qcom_config_esi function Chanwoo Lee
@ 2023-12-19 18:05   ` Christophe JAILLET
  2023-12-20 11:33   ` Manivannan Sadhasivam
  2024-01-04  4:05   ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2023-12-19 18:05 UTC (permalink / raw)
  To: Chanwoo Lee, mani, agross, andersson, konrad.dybcio, jejb,
	martin.petersen, linux-arm-msm, linux-scsi, linux-kernel
  Cc: grant.jung, jt77.jang, dh0421.hwang, sh043.lee

Le 19/12/2023 à 09:27, Chanwoo Lee a écrit :
> From: ChanWoo Lee <cw9316.lee@samsung.com>
> 
> There is only one place where goto is used,
> and it is unnecessary to check the ret value through 'goto out'
> because the ret value is already true.
> 
> Therefore, remove the goto statement and
> integrate the '!ret' condition into the existing code.
> 
> Signed-off-by: ChanWoo Lee <cw9316.lee@samsung.com>

Reviewed-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

> ---
>   drivers/ufs/host/ufs-qcom.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index 17e24270477d..8cf803806326 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -1929,7 +1929,7 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
>   					     ufs_qcom_write_msi_msg);
>   	if (ret) {
>   		dev_err(hba->dev, "Failed to request Platform MSI %d\n", ret);
> -		goto out;
> +		return ret;
>   	}
>   
>   	msi_lock_descs(hba->dev);
> @@ -1964,11 +1964,8 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
>   				      REG_UFS_CFG3);
>   		}
>   		ufshcd_mcq_enable_esi(hba);
> -	}
> -
> -out:
> -	if (!ret)
>   		host->esi_enabled = true;
> +	}
>   
>   	return ret;
>   }


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

* Re: [PATCH] scsi: ufs: qcom: Remove unnecessary goto statement from ufs_qcom_config_esi function
  2023-12-19  8:27 ` [PATCH] scsi: ufs: qcom: Remove unnecessary goto statement from ufs_qcom_config_esi function Chanwoo Lee
  2023-12-19 18:05   ` Christophe JAILLET
@ 2023-12-20 11:33   ` Manivannan Sadhasivam
  2024-01-04  4:05   ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Manivannan Sadhasivam @ 2023-12-20 11:33 UTC (permalink / raw)
  To: Chanwoo Lee
  Cc: agross, andersson, konrad.dybcio, jejb, martin.petersen,
	linux-arm-msm, linux-scsi, linux-kernel, grant.jung, jt77.jang,
	dh0421.hwang, sh043.lee

On Tue, Dec 19, 2023 at 05:27:40PM +0900, Chanwoo Lee wrote:
> From: ChanWoo Lee <cw9316.lee@samsung.com>
> 
> There is only one place where goto is used,
> and it is unnecessary to check the ret value through 'goto out'
> because the ret value is already true.
> 
> Therefore, remove the goto statement and
> integrate the '!ret' condition into the existing code.
> 
> Signed-off-by: ChanWoo Lee <cw9316.lee@samsung.com>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

- Mani

> ---
>  drivers/ufs/host/ufs-qcom.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index 17e24270477d..8cf803806326 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -1929,7 +1929,7 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
>  					     ufs_qcom_write_msi_msg);
>  	if (ret) {
>  		dev_err(hba->dev, "Failed to request Platform MSI %d\n", ret);
> -		goto out;
> +		return ret;
>  	}
>  
>  	msi_lock_descs(hba->dev);
> @@ -1964,11 +1964,8 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
>  				      REG_UFS_CFG3);
>  		}
>  		ufshcd_mcq_enable_esi(hba);
> -	}
> -
> -out:
> -	if (!ret)
>  		host->esi_enabled = true;
> +	}
>  
>  	return ret;
>  }
> -- 
> 2.29.0
> 

-- 
மணிவண்ணன் சதாசிவம்

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

* Re: [PATCH] scsi: ufs: qcom: Remove unnecessary goto statement from ufs_qcom_config_esi function
  2023-12-19  8:27 ` [PATCH] scsi: ufs: qcom: Remove unnecessary goto statement from ufs_qcom_config_esi function Chanwoo Lee
  2023-12-19 18:05   ` Christophe JAILLET
  2023-12-20 11:33   ` Manivannan Sadhasivam
@ 2024-01-04  4:05   ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2024-01-04  4:05 UTC (permalink / raw)
  To: Chanwoo Lee
  Cc: mani, agross, andersson, konrad.dybcio, jejb, martin.petersen,
	linux-arm-msm, linux-scsi, linux-kernel, grant.jung, jt77.jang,
	dh0421.hwang, sh043.lee


Chanwoo,

> There is only one place where goto is used, and it is unnecessary to
> check the ret value through 'goto out' because the ret value is
> already true.

Applied to 6.8/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2024-01-04  4:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20231219082757epcas1p33bda4e0723d3d57552132054d3e5a3fe@epcas1p3.samsung.com>
2023-12-19  8:27 ` [PATCH] scsi: ufs: qcom: Remove unnecessary goto statement from ufs_qcom_config_esi function Chanwoo Lee
2023-12-19 18:05   ` Christophe JAILLET
2023-12-20 11:33   ` Manivannan Sadhasivam
2024-01-04  4:05   ` 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