[U-Boot] [PATCH v6 03/12] nand: add Faraday FTNANDC021 NAND controller support
Kuo-Jung Su
dantesu at gmail.com
Tue Jul 9 03:57:44 CEST 2013
2013/7/9 Scott Wood <scottwood at freescale.com>:
> On 07/08/2013 08:42:01 PM, Kuo-Jung Su wrote:
>>
>> 2013/7/9 Scott Wood <scottwood at freescale.com>:
>> > On 07/03/2013 10:40:35 PM, Kuo-Jung Su wrote:
>> >>
>> >> +#ifndef __ARMEB__
>> >> + put_unaligned_le32(readl(®s->dr), buf + off);
>> >> +#else
>> >> + put_unaligned_be32(readl(®s->dr), buf + off);
>> >> +#endif
>> >
>> >
>> > Can't you just use plain put_unaligned()? Be sure to cast buf + off to
>> > a
>> > 32-bit pointer.
>> >
>>
>> Ummm... I think it'll be better to replace put_unaligned() with memcpy(),
>> just like what your suggested before.
>>
>> So that we don't even have to worry about this endian issue and pointer
>> cast.
>
>
> OK. BTW, it'd be nice if there were a native-endian, fixed-size
> put_unaligned32() -- having a u8 pointer seems like it'd be a common
> situation when dealing with unaligned things (and it's what the underlying
> implementation takes).
>
Got it, thanks
--
Best wishes,
Kuo-Jung Su
More information about the U-Boot
mailing list