[U-Boot] [PATCH] dm: ofnode: use fdt32_t for DT property value to fix sparse warning

sjg at google.com sjg at google.com
Thu Jul 6 17:36:05 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>

Applied to u-boot-dm, thanks!


More information about the U-Boot mailing list