[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c43b3311-8c15-71ec-5f39-1a3b22f928e5@pengutronix.de>
Date: Mon, 28 Sep 2020 08:20:59 +0200
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Joakim Zhang <qiangqing.zhang@....com>,
"linux-can@...r.kernel.org" <linux-can@...r.kernel.org>
Cc: dl-linux-imx <linux-imx@....com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH V2 1/3] can: flexcan: initialize all flexcan memory for
ECC function
On 9/28/20 7:23 AM, Joakim Zhang wrote:
>>>> + for (i = 0; i < ram_init[0].len; i++)
>>>> + priv->write(0, (void __iomem *)regs + ram_init[0].offset +
>>>> +sizeof(u32) * i);
>>>
>>> As the write function only does endian conversion, and you're writing 0 here.
>>> What about using iowrite32_rep() and get rid of the for loop?
>>
>> Thanks for this point, I will update in next version.
>
> Ahhh.. I check iowrite32_rep() writes a buf to single address, no shift for address.
Doh! Right.
> I prefer to use memset_io() here to initialize a block of io memory. What do
> you think?
Of course, that's the correct function for this!
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists