diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2008-07-09 14:10:24 +1000 |
---|---|---|
committer | Gerald Van Baren <vanbaren@cideas.com> | 2008-08-24 22:20:49 -0400 |
commit | fc7758ee4f5782878f2e96876b7bc56cfee0ac66 (patch) | |
tree | d2b1bf6f4f5104265cfaccca64ac043955e2ff8a /libfdt/fdt_wip.c | |
parent | c66830263af19831f2b7db307f79d1943febf7f9 (diff) | |
download | u-boot-imx-fc7758ee4f5782878f2e96876b7bc56cfee0ac66.zip u-boot-imx-fc7758ee4f5782878f2e96876b7bc56cfee0ac66.tar.gz u-boot-imx-fc7758ee4f5782878f2e96876b7bc56cfee0ac66.tar.bz2 |
libfdt: Increase namespace-pollution paranoia
libfdt is supposed to easy to embed in projects all and sundry.
Often, it won't be practical to separate the embedded libfdt's
namespace from that of the surrounding project. Which means there can
be namespace conflicts between even libfdt's internal/static functions
and functions or macros coming from the surrounding project's headers
via libfdt_env.h.
This patch, therefore, renames a bunch of libfdt internal functions
and macros and makes a few other chances to reduce the chances of
namespace collisions with embedding projects. Specifically:
- Internal functions (even static ones) are now named _fdt_*()
- The type and (static) global for the error table in
fdt_strerror() gain an fdt_ prefix
- The unused macro PALIGN is removed
- The memeq and streq macros are removed and open-coded in the
users (they were only used once each)
- Other macros gain an FDT_ prefix
- To save some of the bulk from the previous change, an
FDT_TAGALIGN() macro is introduced, where FDT_TAGALIGN(x) ==
FDT_ALIGN(x, FDT_TAGSIZE)
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'libfdt/fdt_wip.c')
-rw-r--r-- | libfdt/fdt_wip.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libfdt/fdt_wip.c b/libfdt/fdt_wip.c index b336113..e30c81d 100644 --- a/libfdt/fdt_wip.c +++ b/libfdt/fdt_wip.c @@ -76,7 +76,7 @@ int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name, return 0; } -static void nop_region(void *start, int len) +static void _fdt_nop_region(void *start, int len) { uint32_t *p; @@ -93,7 +93,7 @@ int fdt_nop_property(void *fdt, int nodeoffset, const char *name) if (! prop) return len; - nop_region(prop, len + sizeof(*prop)); + _fdt_nop_region(prop, len + sizeof(*prop)); return 0; } @@ -143,6 +143,7 @@ int fdt_nop_node(void *fdt, int nodeoffset) if (endoffset < 0) return endoffset; - nop_region(fdt_offset_ptr_w(fdt, nodeoffset, 0), endoffset - nodeoffset); + _fdt_nop_region(fdt_offset_ptr_w(fdt, nodeoffset, 0), + endoffset - nodeoffset); return 0; } |