lkml.org 
[lkml]   [2022]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [Patch v8 1/4] memory: tegra: Add memory controller channels support
From


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@collabora.com>

Thanks Dmitry.

\
 
 \ /
  Last update: 2022-04-26 09:33    [W:0.192 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site