[U-Boot] [PATCH 2/2] fit: Fix little endian target support

Wolfgang Denk wd at denx.de
Tue Nov 18 09:58:48 CET 2008


Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <1226968111-965-2-git-send-email-plagnioj at jcrosoft.com> you wrote:
> bswap_32 and bswap_64 is for host on target we use
> cpu_to_be32 and cpu_to_be64

Hm.... do you consider this a style cleanup, or is there any real
problem that needs fixing?

>  #if __BYTE_ORDER == __LITTLE_ENDIAN
> +#ifdef USE_HOSTCC
>  #define fdt32_to_cpu(x)		bswap_32(x)
>  #define cpu_to_fdt32(x)		bswap_32(x)
>  #define fdt64_to_cpu(x)		bswap_64(x)
>  #define cpu_to_fdt64(x)		bswap_64(x)
>  #else
> +#define fdt32_to_cpu(x)		cpu_to_be32(x)
> +#define cpu_to_fdt32(x)		cpu_to_be32(x)
> +#define fdt64_to_cpu(x)		cpu_to_be64(x)
> +#define cpu_to_fdt64(x)		cpu_to_be64(x)
> +#endif /* USE_HOSTCC */

This is IMO wrong. If we implement such a change,  then  fdt32_to_cpu
should translate to be32_to_cpu, and fdt64_to_cpu should translate to
be64_to_cpu.

But actually I do not see the need for this change.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Real computer scientists don't comment their  code.  The  identifiers
are so long they can't afford the disk space.


More information about the U-Boot mailing list