[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <691c863c-0923-73f2-eab5-65b4238f545a@nvidia.com>
Date: Tue, 26 Apr 2022 13:02:26 +0530
From: Ashish Mhetre <amhetre@...dia.com>
To: Dmitry Osipenko <dmitry.osipenko@...labora.com>,
krzysztof.kozlowski@...aro.org, thierry.reding@...il.com,
jonathanh@...dia.com, digetx@...il.com, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, linux-kernel@...r.kernel.org,
linux-tegra@...r.kernel.org, devicetree@...r.kernel.org
Cc: vdumpa@...dia.com, Snikam@...dia.com
Subject: Re: [Patch v8 1/4] memory: tegra: Add memory controller channels
support
On 4/26/2022 12:55 AM, Dmitry Osipenko wrote:
> External email: Use caution opening links or attachments
>
>
> 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.
>
Okay, I will update this in v9.
>> + 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.
>
Okay, I will update in next version.
> With that:
>
> Reviewed-by: Dmitry Osipenko <dmitry.osipenko@...labora.com>
Thanks Dmitry.
Powered by blists - more mailing lists