public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Asutosh Das <asutoshd@codeaurora.org>
To: Bean Huo <huobean@gmail.com>
Cc: alim.akhtar@samsung.com, avri.altman@wdc.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com, stanley.chu@mediatek.com,
	beanhuo@micron.com, bvanassche@acm.org, tomas.winkler@intel.com,
	cang@codeaurora.org, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] scsi: ufs: remove several redundant goto statements
Date: Thu, 13 Aug 2020 08:52:03 -0700	[thread overview]
Message-ID: <20200813155203.GA25655@asutoshd-linux1.qualcomm.com> (raw)
In-Reply-To: <20200812143704.30245-3-huobean@gmail.com>

On Wed, Aug 12 2020 at 07:37 -0700, Bean Huo wrote:
>From: Bean Huo <beanhuo@micron.com>
>
>Signed-off-by: Bean Huo <beanhuo@micron.com>
>---
> drivers/scsi/ufs/ufshcd.c | 26 +++++---------------------
> 1 file changed, 5 insertions(+), 21 deletions(-)
>
>diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
>index e3663b85e8ee..cd742c4f78b6 100644
>--- a/drivers/scsi/ufs/ufshcd.c
>+++ b/drivers/scsi/ufs/ufshcd.c
>@@ -4256,10 +4256,8 @@ int ufshcd_make_hba_operational(struct ufs_hba *hba)
> 		dev_err(hba->dev,
> 			"Host controller not ready to process requests");
> 		err = -EIO;
>-		goto out;
> 	}
>
>-out:
> 	return err;
> }
> EXPORT_SYMBOL_GPL(ufshcd_make_hba_operational);
>@@ -5542,10 +5540,8 @@ static bool ufshcd_quirk_dl_nac_errors(struct ufs_hba *hba)
> 			hba->saved_err &= ~UIC_ERROR;
> 		/* clear NAC error */
> 		hba->saved_uic_err &= ~UFSHCD_UIC_DL_NAC_RECEIVED_ERROR;
>-		if (!hba->saved_uic_err) {
>+		if (!hba->saved_uic_err)
> 			err_handling = false;
>-			goto out;
>-		}
> 	}
> out:
> 	spin_unlock_irqrestore(hba->host->host_lock, flags);
>@@ -7604,12 +7600,10 @@ static int ufshcd_config_vreg(struct device *dev,
> 		if (vreg->min_uV && vreg->max_uV) {
> 			min_uV = on ? vreg->min_uV : 0;
> 			ret = regulator_set_voltage(reg, min_uV, vreg->max_uV);
>-			if (ret) {
>+			if (ret)
> 				dev_err(dev,
> 					"%s: %s set voltage failed, err=%d\n",
> 					__func__, name, ret);
>-				goto out;
>-			}
> 		}
> 	}
> out:
>@@ -7672,8 +7666,6 @@ static int ufshcd_setup_vreg(struct ufs_hba *hba, bool on)
> 		goto out;
>
> 	ret = ufshcd_toggle_vreg(dev, info->vccq2, on);
>-	if (ret)
>-		goto out;
>
> out:
> 	if (ret) {
>@@ -7719,10 +7711,8 @@ static int ufshcd_init_vreg(struct ufs_hba *hba)
> 		goto out;
>
> 	ret = ufshcd_get_vreg(dev, info->vccq);
>-	if (ret)
>-		goto out;
>-
>-	ret = ufshcd_get_vreg(dev, info->vccq2);
>+	if (!ret)
>+		ret = ufshcd_get_vreg(dev, info->vccq2);
> out:
> 	return ret;
> }
>@@ -7866,12 +7856,7 @@ static int ufshcd_variant_hba_init(struct ufs_hba *hba)
>
> 	err = ufshcd_vops_setup_regulators(hba, true);
> 	if (err)
>-		goto out_exit;
>-
>-	goto out;
>-
>-out_exit:
>-	ufshcd_vops_exit(hba);
>+		ufshcd_vops_exit(hba);
> out:
> 	if (err)
> 		dev_err(hba->dev, "%s: variant %s init failed err %d\n",
>@@ -8036,7 +8021,6 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba,
> 	}
>
> 	cmd[4] = pwr_mode << 4;
>-
Change LGTM;
Nit-pick, line removed here by mistake, perhaps?

> 	/*
> 	 * Current function would be generally called from the power management
> 	 * callbacks hence set the RQF_PM flag so that it doesn't resume the
>-- 
>2.17.1
>

  reply	other threads:[~2020-08-13 15:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12 14:37 [PATCH v2 0/2] make UFS dev_cmd more readable Bean Huo
2020-08-12 14:37 ` [PATCH v2 1/2] scsi: ufs: change ufshcd_comp_devman_upiu() to ufshcd_compose_devman_upiu() Bean Huo
2020-08-13 15:55   ` Asutosh Das
2020-08-14  9:29     ` Can Guo
2020-08-12 14:37 ` [PATCH v2 2/2] scsi: ufs: remove several redundant goto statements Bean Huo
2020-08-13 15:52   ` Asutosh Das [this message]
2020-08-14  9:52     ` Bean Huo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200813155203.GA25655@asutoshd-linux1.qualcomm.com \
    --to=asutoshd@codeaurora.org \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=cang@codeaurora.org \
    --cc=huobean@gmail.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stanley.chu@mediatek.com \
    --cc=tomas.winkler@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox