[U-Boot] [PATCH 1/5] treewide: include libfdt_env.h before fdt.h

Gerald Van Baren vanbaren at cideas.com
Fri Jan 18 12:59:46 CET 2013


On 01/17/2013 06:50 PM, David Gibson wrote:
> On Thu, Jan 17, 2013 at 01:32:45PM -0500, Jerry Van Baren wrote:
>> Hi Scott, Kim, David,

[snip]

>> libfdt_env.h is where Kim typedef'ed fdt16_t, fdt32_t, fdt64_t
>> 
>> I suspect the original intent was to have <libfdt.h> be the file 
>> that people #included.  For whatever reason, most includes are 
>> (picking on fdt_ro.c arbitrarily): 51 #include "libfdt_env.h" 53
>> #include <fdt.h> 54 #include <libfdt.h> Since libfdt.h #includes
>> fdt.h and libfdt_env.h, lines 51 and 53 (above) are redundant.
>> It sorts out OK in dtc because libfdt_env.h includes stdint.h and
>> defines fdt*_t, but it messes me up in u-boot where (currently)
>> libfdt_env.h does *not* include stdint.h...
> 
> Ok, so, the uboot libfdt_env.h should be fixed to define uintXX_t
> and fdtXX_t (either by including stdint or my other means).  The
> purpose of libfdt_env.h is to define the things that libfdt
> requires, and those types are (now) such a requirement.

I like the move, but have not done it (yet).  I made a trial patch
(see below) that uses libfdt.h as the interface and cleans out the
(now redundant) other *fdt*.h includes.  If this is in the right
direction, I'll move the fdtXX_t typedefs and formally submit it.

The test suite has one failure, but it fails with or without my changes.

$ make check | grep FAIL
fdtget-runtest.sh 77 121 66 111 97 114 100 78 97 109 101 0 77 121 66
111 97 114 100 70 97 109 105 108 121 78 97 109 101 0
label01.dts.fdtget.test.dtb / compatible:	FAIL Results differ from
expected
*                FAIL:	1

********** TEST SUMMARY
*     Total testcases:	1443
*                PASS:	1442
*                FAIL:	1
*   Bad configuration:	0
* Strange test result:	0
**********

gvb



More information about the U-Boot mailing list