X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=libfdt%2Ffdt_wip.c;h=e30c81d91a91033f945b7b5782162622bf93d32e;hb=032a1c934ef4dc003281f57302b6e693062c1868;hp=88e24b8318f449e4ab7902fc27b4e7345948299d;hpb=74ac5facb988fc488a707db228b177ead63a6541;p=oweals%2Fu-boot.git diff --git a/libfdt/fdt_wip.c b/libfdt/fdt_wip.c index 88e24b8318..e30c81d91a 100644 --- a/libfdt/fdt_wip.c +++ b/libfdt/fdt_wip.c @@ -50,8 +50,12 @@ */ #include "libfdt_env.h" +#ifndef USE_HOSTCC #include #include +#else +#include "fdt_host.h" +#endif #include "libfdt_internal.h" @@ -72,11 +76,11 @@ 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; - for (p = start; (void *)p < (start + len); p++) + for (p = start; (char *)p < ((char *)start + len); p++) *p = cpu_to_fdt32(FDT_NOP); } @@ -89,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; } @@ -139,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; }