[U-Boot] [PATCH] dm: ofnode: use fdt32_t for DT property value to fix sparse warning
Simon Glass
sjg at chromium.org
Thu Jul 6 04:49:26 UTC 2017
On 22 June 2017 at 02:57, Masahiro Yamada <yamada.masahiro at socionext.com> wrote:
> DTB is encoded in big endian. When we retrieve property values,
> we need to use fdt32_to_cpu (aka be32_to_cpu) for endian conversion.
> This is a bit error-prone, but sparse is useful to detect endian
> mismatch.
>
> We need to use (fdt32_t *) instead of (u32 *) for a pointer of a
> property value. Otherwise sparse warns "cast to restricted __be32".
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
> ---
>
> drivers/core/ofnode.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Simon Glass <sjg at chromium.org>
More information about the U-Boot
mailing list