public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Asutosh Das <quic_asutoshd@quicinc.com>,
	quic_cang@quicinc.com, martin.petersen@oracle.com,
	linux-scsi@vger.kernel.org
Cc: quic_nguyenb@quicinc.com, quic_xiaosenh@quicinc.com,
	stanley.chu@mediatek.com, eddie.huang@mediatek.com,
	daejun7.park@samsung.com, avri.altman@wdc.com, mani@kernel.org,
	beanhuo@micron.com, linux-arm-msm@vger.kernel.org,
	Alim Akhtar <alim.akhtar@samsung.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 06/16] ufs: core: mcq: Configure resource regions
Date: Wed, 9 Nov 2022 13:21:46 -0800	[thread overview]
Message-ID: <2e3adf52-8d9f-bb6d-5f02-cc3032e9b1ab@acm.org> (raw)
In-Reply-To: <1d571cf3e8d07933f7d6d1c0bfd30402f3a5abbf.1668022680.git.quic_asutoshd@quicinc.com>

On 11/9/22 11:41, Asutosh Das wrote:
> +	/* Manually allocate MCQ resource from ufs_mem */

Manually -> explicitly? The meaning of "manually" is "by hand and not by 
machine". Software is always executed by a CPU (machine) so nothing 
happens manually in software.

> +	ret = insert_resource(&iomem_resource, res_mcq);
> +	if (ret) {
> +		dev_err(hba->dev, "Failed to insert MCQ resource, err=%d\n",
> +			ret);
> +		devm_kfree(hba->dev, res_mcq);
> +		return ret;
> +	}
> +
> +	res->base = devm_ioremap_resource(hba->dev, res_mcq);
> +	if (IS_ERR(res->base)) {
> +		dev_err(hba->dev, "MCQ registers mapping failed, err=%d\n",
> +			(int)PTR_ERR(res->base));
> +		ret = PTR_ERR(res->base);
> +		res->base = NULL;
> +		remove_resource(res_mcq);
> +		devm_kfree(hba->dev, res_mcq);
> +		return ret;
> +	}

I see duplicated code in error paths. Please move the code for freeing 
resources past the "return 0" statement and use goto statements to jump 
to that code in case of an error.

Thanks,

Bart.

  reply	other threads:[~2022-11-09 21:21 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 19:41 [PATCH v4 00/16] Add Multi Circular Queue Support Asutosh Das
2022-11-09 19:41 ` [PATCH v4 01/16] ufs: core: Optimize duplicate code to read extended feature Asutosh Das
2022-11-09 20:54   ` Bart Van Assche
2022-11-09 19:41 ` [PATCH v4 02/16] ufs: core: Probe for ext_iid support Asutosh Das
2022-11-09 20:56   ` Bart Van Assche
2022-11-10 10:47   ` Avri Altman
2022-11-09 19:41 ` [PATCH v4 03/16] ufs: core: Introduce Multi-circular queue capability Asutosh Das
2022-11-09 20:59   ` Bart Van Assche
2022-11-09 19:41 ` [PATCH v4 04/16] ufs: core: Defer adding host to scsi if mcq is supported Asutosh Das
2022-11-09 19:41 ` [PATCH v4 05/16] ufs: core: mcq: Add Multi Circular Queue support Asutosh Das
2022-11-09 21:16   ` Bart Van Assche
2022-11-09 19:41 ` [PATCH v4 06/16] ufs: core: mcq: Configure resource regions Asutosh Das
2022-11-09 21:21   ` Bart Van Assche [this message]
2022-11-09 19:41 ` [PATCH v4 07/16] ufs: core: mcq: Calculate queue depth Asutosh Das
2022-11-09 21:28   ` Bart Van Assche
2022-11-09 19:41 ` [PATCH v4 08/16] ufs: core: mcq: Allocate memory for mcq mode Asutosh Das
2022-11-09 21:36   ` Bart Van Assche
2022-11-09 19:41 ` [PATCH v4 09/16] ufs: core: mcq: Configure operation and runtime interface Asutosh Das
2022-11-09 21:39   ` Bart Van Assche
2022-11-09 19:41 ` [PATCH v4 10/16] ufs: core: mcq: Use shared tags for MCQ mode Asutosh Das
2022-11-09 19:41 ` [PATCH v4 11/16] ufs: core: Prepare ufshcd_send_command for mcq Asutosh Das
2022-11-09 19:41 ` [PATCH v4 12/16] ufs: core: mcq: Find hardware queue to queue request Asutosh Das
2022-11-09 19:41 ` [PATCH v4 13/16] ufs: core: Prepare for completion in mcq Asutosh Das
2022-11-09 19:41 ` [PATCH v4 14/16] ufs: mcq: Add completion support of a cqe Asutosh Das
2022-11-11 19:54   ` kernel test robot
2022-11-11 20:15   ` kernel test robot
2022-11-09 19:41 ` [PATCH v4 15/16] ufs: core: mcq: Add completion support in poll Asutosh Das
2022-11-09 19:41 ` [PATCH v4 16/16] ufs: core: mcq: Enable Multi Circular Queue Asutosh Das

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=2e3adf52-8d9f-bb6d-5f02-cc3032e9b1ab@acm.org \
    --to=bvanassche@acm.org \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=daejun7.park@samsung.com \
    --cc=eddie.huang@mediatek.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=quic_asutoshd@quicinc.com \
    --cc=quic_cang@quicinc.com \
    --cc=quic_nguyenb@quicinc.com \
    --cc=quic_xiaosenh@quicinc.com \
    --cc=stanley.chu@mediatek.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