diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2007-11-19 17:26:22 +1100 |
---|---|---|
committer | Jon Loeliger <jdl@freescale.com> | 2007-11-20 09:01:29 -0600 |
commit | 2cf86939aff2692098396e7f25ce299e7195fa12 (patch) | |
tree | 210a3ec9de082e9882d91acb1d0702d7f83a2ece /tests/path_offset.c | |
parent | 9521dc5ecc66c158cd6853cabba2c29f545780f6 (diff) | |
download | dtc-2cf86939aff2692098396e7f25ce299e7195fa12.tar.gz |
libfdt: Abolish fdt_offset_ptr_typed()
The fdt_offset_ptr_typed() macro seemed like a good idea at the time.
However, it's not actually used all that often, it can silently throw
away const qualifications and it uses a gcc extension (typeof) which
I'd prefer to avoid for portability.
Therefore, this patch gets rid of it (and the fdt_offset_ptr_typed_w()
variant which was never used at all). It also makes a few variables
const in testcases, which always should have been const, but weren't
caught before because of the aforementioned silent discards.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tests/path_offset.c')
-rw-r--r-- | tests/path_offset.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/path_offset.c b/tests/path_offset.c index 834bc93..4b014ac 100644 --- a/tests/path_offset.c +++ b/tests/path_offset.c @@ -31,7 +31,7 @@ int check_subnode(void *fdt, int parent, const char *name) { int offset; - struct fdt_node_header *nh; + const struct fdt_node_header *nh; uint32_t tag; verbose_printf("Checking subnode \"%s\" of %d...", name, parent); @@ -39,7 +39,7 @@ int check_subnode(void *fdt, int parent, const char *name) verbose_printf("offset %d...", offset); if (offset < 0) FAIL("fdt_subnode_offset(\"%s\"): %s", name, fdt_strerror(offset)); - nh = fdt_offset_ptr_typed(fdt, offset, nh); + nh = fdt_offset_ptr(fdt, offset, sizeof(*nh)); verbose_printf("pointer %p\n", nh); if (! nh) FAIL("NULL retrieving subnode \"%s\"", name); |