Re: [U-Boot] [PATCH v3 3/4] dtc/libfdt: introduce fdt types for annotation by endian checkers

2012-11-18 Thread David Gibson
On Wed, Nov 14, 2012 at 11:12:04PM -0600, Kim Phillips wrote: On Thu, 15 Nov 2012 15:43:40 +1100 David Gibson da...@gibson.dropbear.id.au wrote: On Wed, Nov 14, 2012 at 06:59:58PM -0600, Kim Phillips wrote: +#define EXTRACT_BYTE(x, n) ((unsigned long long)((uint8_t *)x)[n]) +#define

[U-Boot] [PATCH v3 3/4] dtc/libfdt: introduce fdt types for annotation by endian checkers

2012-11-14 Thread Kim Phillips
Projects such as linux and u-boot run sparse on libfdt. libfdt contains the notion of endianness via usage of endian conversion functions such as fdt32_to_cpu. As such, in order to pass endian checks, libfdt has to annotate its fdt variables such that sparse can warn when mixing bitwise and

Re: [U-Boot] [PATCH v3 3/4] dtc/libfdt: introduce fdt types for annotation by endian checkers

2012-11-14 Thread David Gibson
On Wed, Nov 14, 2012 at 06:59:58PM -0600, Kim Phillips wrote: Projects such as linux and u-boot run sparse on libfdt. libfdt contains the notion of endianness via usage of endian conversion functions such as fdt32_to_cpu. As such, in order to pass endian checks, libfdt has to annotate its

Re: [U-Boot] [PATCH v3 3/4] dtc/libfdt: introduce fdt types for annotation by endian checkers

2012-11-14 Thread Kim Phillips
On Thu, 15 Nov 2012 15:43:40 +1100 David Gibson da...@gibson.dropbear.id.au wrote: On Wed, Nov 14, 2012 at 06:59:58PM -0600, Kim Phillips wrote: +#define EXTRACT_BYTE(x, n) ((unsigned long long)((uint8_t *)x)[n]) +#define __SWAB16(x) ((EXTRACT_BYTE(x, 0) 8) | EXTRACT_BYTE(x, 1)) +#define