diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2007-11-20 13:35:46 +1100 |
---|---|---|
committer | Jon Loeliger <jdl@freescale.com> | 2007-11-20 09:00:37 -0600 |
commit | 9521dc5ecc66c158cd6853cabba2c29f545780f6 (patch) | |
tree | 066c76f58e756bc166b2ed9d670c8975ecc04961 /tests/testdata.h | |
parent | 682576d85bd159fc25ef99ab35a997fda172592e (diff) | |
download | dtc-9521dc5ecc66c158cd6853cabba2c29f545780f6.zip dtc-9521dc5ecc66c158cd6853cabba2c29f545780f6.tar.gz dtc-9521dc5ecc66c158cd6853cabba2c29f545780f6.tar.bz2 |
libfdt: Abolish _typed() variants, add _cell() variants
In a number of places through libfdt and its tests, we have *_typed()
macro variants on functions which use gcc's typeof and statement
expression extensions to allow passing literals where the underlying
function takes a buffer and size.
These seemed like a good idea at the time, but in fact they have some
problems. They use typeof and statement expressions, extensions I'd
prefer to avoid for portability. Plus, they have potential gotchas -
although they'll deal with the size of the thing passed, they won't
deal with other representation issues (like endianness) and results
could be very strange if the type of the expression passed isn't what
you think it is.
In fact, the only users of these _typed() macros were when the value
passed is a single cell (32-bit integer). Therefore, this patch
removes all these _typed() macros and replaces them with explicit
_cell() variants which handle a single 32-bit integer, and which also
perform endian convesions as appropriate.
With this in place, it now becomes easy to use standardized big-endian
representation for integer valued properties in the testcases,
regardless of the platform we're running on. We therefore do that,
which has the additional advantage that all the example trees created
during a test run are now byte-for-byte identical regardless of
platform.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tests/testdata.h')
-rw-r--r-- | tests/testdata.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/testdata.h b/tests/testdata.h index 130026f..0f7f2fa 100644 --- a/tests/testdata.h +++ b/tests/testdata.h @@ -20,8 +20,8 @@ #define TEST_ADDR_2 ASM_CONST_LL(123456789) #define TEST_SIZE_2 ASM_CONST_LL(010000) -#define TEST_VALUE_1 cell_to_fdt(0xdeadbeef) -#define TEST_VALUE_2 cell_to_fdt(123456789) +#define TEST_VALUE_1 0xdeadbeef +#define TEST_VALUE_2 123456789 #define PHANDLE_1 0x2000 #define PHANDLE_2 0x2001 |