[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKohpom5QmO5vbREsMgi4EefLpBxXsk=QWVaZwTwC_Knf72GVA@mail.gmail.com>
Date: Thu, 25 Oct 2012 19:48:09 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Rob Herring <robherring2@...il.com>
Cc: grant.likely@...retlab.ca, spear-devel@...t.st.com,
devicetree-discuss@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
andriy.shevchenko@...el.com
Subject: Re: [PATCH] dt: add helper function to read u8 & u16 variables & arrays
On 25 October 2012 18:49, Rob Herring <robherring2@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists