X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=common%2Fft_build.c;h=5a0575e89aa4036a6b1af7bf82d01c9426669a19;hb=2242f5369822bc7780db95c47985bb408ea9157b;hp=b5a997c1ba5ed514cdb1e1e9650bd4757c938b1f;hpb=ad09083c3736ea72bceee92721933513d3137b66;p=u-boot diff --git a/common/ft_build.c b/common/ft_build.c index b5a997c1ba..5a0575e89a 100644 --- a/common/ft_build.c +++ b/common/ft_build.c @@ -29,6 +29,7 @@ #include #include +#include #undef DEBUG @@ -87,9 +88,9 @@ static int lookup_string(struct ft_cxt *cxt, const char *name) p = cxt->p; while (p < cxt->p_end) { - if (strcmp(p, name) == 0) + if (strcmp((char *)p, name) == 0) return p - cxt->p; - p += strlen(p) + 1; + p += strlen((char *)p) + 1; } return -1; @@ -103,7 +104,7 @@ void ft_prop(struct ft_cxt *cxt, const char *name, const void *data, int sz) if (off == -1) { memcpy(cxt->p_end, name, strlen(name) + 1); off = cxt->p_end - cxt->p; - cxt->p_end += strlen(name) + 2; + cxt->p_end += strlen(name) + 1; } /* now put offset from beginning of *STRUCTURE* */ @@ -143,9 +144,9 @@ void ft_init_cxt(struct ft_cxt *cxt, void *blob) cxt->p_rsvmap += SIZE_OF_RSVMAP_ENTRY; } - cxt->p_start = (char*)bph + bph->off_dt_struct; - cxt->p_end = (char *)bph + bph->totalsize; - cxt->p = (char *)bph + bph->off_dt_strings; + cxt->p_start = (u8 *)bph + bph->off_dt_struct; + cxt->p_end = (u8 *)bph + bph->totalsize; + cxt->p = (u8 *)bph + bph->off_dt_strings; } /* add a reserver physical area to the rsvmap */ @@ -180,11 +181,6 @@ void ft_finalize_tree(struct ft_cxt *cxt) { bph->dt_strings_size = cxt->p_end - cxt->p; } -static inline int isprint(int c) -{ - return c >= 0x20 && c <= 0x7e; -} - static int is_printable_string(const void *data, int len) { const char *s = data; @@ -219,7 +215,9 @@ static void print_data(const void *data, int len) return; if (is_printable_string(data, len)) { - printf(" = \"%s\"", (char *)data); + puts(" = \""); + puts(data); + puts("\""); return; }