linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ufs: host: ufs-qcom: Return directly if MCQ resource is provided in DT
@ 2023-03-01  7:31 Manivannan Sadhasivam
  2023-03-01 18:07 ` Bart Van Assche
  0 siblings, 1 reply; 3+ messages in thread
From: Manivannan Sadhasivam @ 2023-03-01  7:31 UTC (permalink / raw)
  To: jejb, martin.petersen
  Cc: linux-arm-msm, linux-scsi, linux-kernel, bvanassche,
	quic_asutoshd, Manivannan Sadhasivam

Instead of using a goto label to return, let's return directly in the
"if" condition after setting mcq_base.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/ufs/host/ufs-qcom.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index 34fc453f3eb1..d90f963eed02 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -1460,8 +1460,10 @@ static int ufs_qcom_mcq_config_resource(struct ufs_hba *hba)
 	/* MCQ resource provided in DT */
 	res = &hba->res[RES_MCQ];
 	/* Bail if MCQ resource is provided */
-	if (res->base)
-		goto out;
+	if (res->base) {
+		hba->mcq_base = res->base;
+		return 0;
+	}
 
 	/* Explicitly allocate MCQ resource from ufs_mem */
 	res_mcq = devm_kzalloc(hba->dev, sizeof(*res_mcq), GFP_KERNEL);
@@ -1489,9 +1491,6 @@ static int ufs_qcom_mcq_config_resource(struct ufs_hba *hba)
 		goto ioremap_err;
 	}
 
-out:
-	hba->mcq_base = res->base;
-	return 0;
 ioremap_err:
 	res->base = NULL;
 	remove_resource(res_mcq);
-- 
2.25.1


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

* Re: [PATCH] ufs: host: ufs-qcom: Return directly if MCQ resource is provided in DT
  2023-03-01  7:31 [PATCH] ufs: host: ufs-qcom: Return directly if MCQ resource is provided in DT Manivannan Sadhasivam
@ 2023-03-01 18:07 ` Bart Van Assche
  2023-03-02  7:26   ` Manivannan Sadhasivam
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2023-03-01 18:07 UTC (permalink / raw)
  To: Manivannan Sadhasivam, jejb, martin.petersen
  Cc: linux-arm-msm, linux-scsi, linux-kernel, quic_asutoshd

On 2/28/23 23:31, Manivannan Sadhasivam wrote:
> Instead of using a goto label to return, let's return directly in the
> "if" condition after setting mcq_base.
> 
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>   drivers/ufs/host/ufs-qcom.c | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index 34fc453f3eb1..d90f963eed02 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -1460,8 +1460,10 @@ static int ufs_qcom_mcq_config_resource(struct ufs_hba *hba)
>   	/* MCQ resource provided in DT */
>   	res = &hba->res[RES_MCQ];
>   	/* Bail if MCQ resource is provided */
> -	if (res->base)
> -		goto out;
> +	if (res->base) {
> +		hba->mcq_base = res->base;
> +		return 0;
> +	}
>   
>   	/* Explicitly allocate MCQ resource from ufs_mem */
>   	res_mcq = devm_kzalloc(hba->dev, sizeof(*res_mcq), GFP_KERNEL);
> @@ -1489,9 +1491,6 @@ static int ufs_qcom_mcq_config_resource(struct ufs_hba *hba)
>   		goto ioremap_err;
>   	}
>   
> -out:
> -	hba->mcq_base = res->base;
> -	return 0;
>   ioremap_err:
>   	res->base = NULL;
>   	remove_resource(res_mcq);

This patch changes the behavior for the success case without mentioning 
this in the patch description. So I assume that the behavior change is 
unintentional and hence that this patch should be dropped?

Bart.

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

* Re: [PATCH] ufs: host: ufs-qcom: Return directly if MCQ resource is provided in DT
  2023-03-01 18:07 ` Bart Van Assche
@ 2023-03-02  7:26   ` Manivannan Sadhasivam
  0 siblings, 0 replies; 3+ messages in thread
From: Manivannan Sadhasivam @ 2023-03-02  7:26 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: jejb, martin.petersen, linux-arm-msm, linux-scsi, linux-kernel,
	quic_asutoshd

On Wed, Mar 01, 2023 at 10:07:41AM -0800, Bart Van Assche wrote:
> On 2/28/23 23:31, Manivannan Sadhasivam wrote:
> > Instead of using a goto label to return, let's return directly in the
> > "if" condition after setting mcq_base.
> > 
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > ---
> >   drivers/ufs/host/ufs-qcom.c | 9 ++++-----
> >   1 file changed, 4 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> > index 34fc453f3eb1..d90f963eed02 100644
> > --- a/drivers/ufs/host/ufs-qcom.c
> > +++ b/drivers/ufs/host/ufs-qcom.c
> > @@ -1460,8 +1460,10 @@ static int ufs_qcom_mcq_config_resource(struct ufs_hba *hba)
> >   	/* MCQ resource provided in DT */
> >   	res = &hba->res[RES_MCQ];
> >   	/* Bail if MCQ resource is provided */
> > -	if (res->base)
> > -		goto out;
> > +	if (res->base) {
> > +		hba->mcq_base = res->base;
> > +		return 0;
> > +	}
> >   	/* Explicitly allocate MCQ resource from ufs_mem */
> >   	res_mcq = devm_kzalloc(hba->dev, sizeof(*res_mcq), GFP_KERNEL);
> > @@ -1489,9 +1491,6 @@ static int ufs_qcom_mcq_config_resource(struct ufs_hba *hba)
> >   		goto ioremap_err;
> >   	}
> > -out:
> > -	hba->mcq_base = res->base;
> > -	return 0;
> >   ioremap_err:
> >   	res->base = NULL;
> >   	remove_resource(res_mcq);
> 
> This patch changes the behavior for the success case without mentioning this
> in the patch description. So I assume that the behavior change is
> unintentional and hence that this patch should be dropped?
> 

Sorry, my bad here :( Please ignore this patch.

Thanks,
Mani

> Bart.

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

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

end of thread, other threads:[~2023-03-02  7:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-01  7:31 [PATCH] ufs: host: ufs-qcom: Return directly if MCQ resource is provided in DT Manivannan Sadhasivam
2023-03-01 18:07 ` Bart Van Assche
2023-03-02  7:26   ` Manivannan Sadhasivam

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).