All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Ashish Mhetre <amhetre@nvidia.com>,
	krzysztof.kozlowski@linaro.org, thierry.reding@gmail.com,
	jonathanh@nvidia.com, digetx@gmail.com, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, linux-kernel@vger.kernel.org,
	linux-tegra@vger.kernel.org, devicetree@vger.kernel.org
Cc: vdumpa@nvidia.com, Snikam@nvidia.com
Subject: Re: [Patch v8 1/4] memory: tegra: Add memory controller channels support
Date: Mon, 25 Apr 2022 22:25:40 +0300	[thread overview]
Message-ID: <5ddaf113-c8f6-7c9c-5bf6-27f2f7855d24@collabora.com> (raw)
In-Reply-To: <20220425075036.30098-2-amhetre@nvidia.com>

On 4/25/22 10:50, Ashish Mhetre wrote:
> +static int tegra186_mc_map_regs(struct tegra_mc *mc)
> +{
> +	struct platform_device *pdev = to_platform_device(mc->dev);
> +	int i;
> +
> +	mc->bcast_ch_regs = devm_platform_ioremap_resource_byname(pdev, "broadcast");
> +	if (IS_ERR(mc->bcast_ch_regs)) {
> +		if (PTR_ERR(mc->bcast_ch_regs) == -EINVAL) {
> +			dev_warn(&pdev->dev, "Broadcast channel is missing, please update your device-tree\n");
> +			mc->bcast_ch_regs = NULL;
> +			return 0;
> +		}
> +		return PTR_ERR(mc->bcast_ch_regs);
> +	}
> +
> +	mc->ch_regs = devm_kcalloc(mc->dev, mc->soc->num_channels,
> +				   sizeof(void __iomem *), GFP_KERNEL);

You should use sizeof(*mc->ch_regs) in general to prevent mistakes.

> +	if (!mc->ch_regs)
> +		return -ENOMEM;
> +
> +	for (i = 0; i < mc->soc->num_channels; i++) {
> +		char name[5];
> +
> +		snprintf(name, sizeof(name), "ch%u", i);

The type of "i" variable is int, change it to unsigned int.

With that:

Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>

  reply	other threads:[~2022-04-25 19:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25  7:50 [Patch v8 0/4] memory: tegra: Add MC channels and error logging Ashish Mhetre
2022-04-25  7:50 ` [Patch v8 1/4] memory: tegra: Add memory controller channels support Ashish Mhetre
2022-04-25 19:25   ` Dmitry Osipenko [this message]
2022-04-26  7:32     ` Ashish Mhetre
2022-04-25  7:50 ` [Patch v8 2/4] memory: tegra: Add MC error logging on tegra186 onward Ashish Mhetre
2022-04-25 19:39   ` Dmitry Osipenko
2022-04-26  7:35     ` Ashish Mhetre
2022-04-25  7:50 ` [Patch v8 3/4] dt-bindings: memory: tegra: Update validation for reg and reg-names Ashish Mhetre
2022-04-25 13:31   ` Rob Herring
2022-04-25 21:33   ` Rob Herring
2022-04-25  7:50 ` [Patch v8 4/4] arm64: tegra: Add memory controller channels Ashish Mhetre

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=5ddaf113-c8f6-7c9c-5bf6-27f2f7855d24@collabora.com \
    --to=dmitry.osipenko@collabora.com \
    --cc=Snikam@nvidia.com \
    --cc=amhetre@nvidia.com \
    --cc=devicetree@vger.kernel.org \
    --cc=digetx@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=vdumpa@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.