Lines Matching refs:len

31 static int fdt_parse_prop(char *const*newval, int count, char *data, int *len);
33 static int is_printable_string(const void *data, int len);
52 static int fdt_value_env_set(const void *nodep, int len, const char *var) in fdt_value_env_set() argument
54 if (is_printable_string(nodep, len)) in fdt_value_env_set()
56 else if (len == 4) { in fdt_value_env_set()
61 } else if (len%4 == 0 && len <= 20) { in fdt_value_env_set()
66 for (i = 0; i < len; i += sizeof(unsigned int)) in fdt_value_env_set()
162 int len; in do_fdt() local
167 len = simple_strtoul(argv[1], NULL, 16); in do_fdt()
168 if (len < fdt_totalsize(blob)) { in do_fdt()
171 len, fdt_totalsize(blob)); in do_fdt()
176 err = fdt_open_into(blob, blob, len); in do_fdt()
200 int len; in do_fdt() local
220 len = fdt_totalsize(working_fdt); in do_fdt()
222 len = simple_strtoul(argv[4], NULL, 16); in do_fdt()
223 if (len < fdt_totalsize(working_fdt)) { in do_fdt()
226 len, fdt_totalsize(working_fdt)); in do_fdt()
234 err = fdt_open_into(working_fdt, newaddr, len); in do_fdt()
295 int len; /* new length of the property */ in do_fdt() local
318 len = 0; in do_fdt()
320 ptmp = fdt_getprop(working_fdt, nodeoffset, prop, &len); in do_fdt()
321 if (len > SCRATCHPAD) { in do_fdt()
323 len); in do_fdt()
327 memcpy(data, ptmp, len); in do_fdt()
329 ret = fdt_parse_prop(&argv[4], argc - 4, data, &len); in do_fdt()
334 ret = fdt_setprop(working_fdt, nodeoffset, prop, data, len); in do_fdt()
350 int len = 0; /* new length of the property */ in do_fdt() local
416 working_fdt, nodeoffset, prop, &len); in do_fdt()
417 if (len == 0) { in do_fdt()
421 } else if (nodep && len > 0) { in do_fdt()
425 ret = fdt_value_env_set(nodep, len, in do_fdt()
439 sprintf(buf, "0x%08X", len); in do_fdt()
446 fdt_strerror(len)); in do_fdt()
797 static int fdt_parse_prop(char * const *newval, int count, char *data, int *len) in fdt_parse_prop() argument
804 *len = 0; in fdt_parse_prop()
828 *len += 4; in fdt_parse_prop()
861 *len = *len + 1; in fdt_parse_prop()
877 *len += length; in fdt_parse_prop()
890 static int is_printable_string(const void *data, int len) in is_printable_string() argument
895 if (len == 0) in is_printable_string()
899 if (s[len - 1] != '\0' && s[len - 1] != '\n') in is_printable_string()
903 while (((*s == '\0') || isprint(*s) || isspace(*s)) && (len > 0)) { in is_printable_string()
911 if (len == 1) in is_printable_string()
917 len--; in is_printable_string()
921 if (*s != '\0' || (len != 0)) in is_printable_string()
933 static void print_data(const void *data, int len) in print_data() argument
940 if (len == 0) in print_data()
950 if (is_printable_string(data, len)) { in print_data()
953 while (j < len) { in print_data()
964 if ((len %4) == 0) { in print_data()
965 if (len > max_dump) in print_data()
966 printf("* 0x%p [0x%08x]", data, len); in print_data()
971 for (j = 0, p = data; j < len/4; j++) in print_data()
973 j < (len/4 - 1) ? " " : ""); in print_data()
977 if (len > max_dump) in print_data()
978 printf("* 0x%p [0x%08x]", data, len); in print_data()
983 for (j = 0, s = data; j < len; j++) in print_data()
984 printf("%02x%s", s[j], j < len - 1 ? " " : ""); in print_data()
1005 int len; /* length of the property */ in fdt_print() local
1023 nodep = fdt_getprop (working_fdt, nodeoffset, prop, &len); in fdt_print()
1024 if (len == 0) { in fdt_print()
1028 } else if (nodep && len > 0) { in fdt_print()
1030 print_data (nodep, len); in fdt_print()
1035 fdt_strerror(len)); in fdt_print()
1076 len = fdt32_to_cpu(fdt_prop->len); in fdt_print()
1078 if (len < 0) { in fdt_print()
1080 fdt_strerror(len)); in fdt_print()
1082 } else if (len == 0) { in fdt_print()
1093 print_data (nodep, len); in fdt_print()