Re: [PATCH V2 1/3] can: flexcan: initialize all flexcan memory for ECC function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 |

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux