Messages in this thread | | | Date | Thu, 25 Oct 2012 19:48:09 +0530 | Subject | Re: [PATCH] dt: add helper function to read u8 & u16 variables & arrays | From | Viresh Kumar <> |
| |
On 25 October 2012 18:49, Rob Herring <robherring2@gmail.com> wrote: > For some reason, this does not show up on the list either in my mail or > mail list archives, but it is in patchwork. Can you resend it please.
Strange. I kept you in --to field. I know people added in cc are sometimes removed by the list when they have selected "avoid duplicate mails" option for their list.
> The main question I have is be32_to_cpup() the right thing to do. I > would expect byte arrays to not need endian conversion, but I haven't > looked at how '/bits/ x' data is stored.
The problem i see here is:
The data passed via DT comes as Little Endian in the kernel.
For a little endian system, byte zero will contain the data and so (u8) val
look to be the correct thing.
For a big endian system, byte 3 will contain data as it is swapped by be32_to_cpup. So (u8) val would return value stored by byte 0 instead. ??
Does my logic look correct to you??
-- viresh
| |