| 468 | } |
| 469 | |
| 470 | static rt_bool_t dts_test_string_list(const void *value, int size) |
| 471 | { |
| 472 | const char *str, *str_start, *str_end; |
| 473 | |
| 474 | if (!size) |
| 475 | { |
| 476 | return RT_FALSE; |
| 477 | } |
| 478 | |
| 479 | str = value; |
| 480 | |
| 481 | /* String end with '\0' */ |
| 482 | if (str[size - 1] != '\0') |
| 483 | { |
| 484 | return RT_FALSE; |
| 485 | } |
| 486 | |
| 487 | /* Get string list end */ |
| 488 | str_end = str + size; |
| 489 | |
| 490 | while (str < str_end) |
| 491 | { |
| 492 | str_start = str; |
| 493 | /* Before string list end, not '\0' and a printable characters */ |
| 494 | while (str < str_end && *str && ((unsigned char)*str >= ' ' && (unsigned char)*str <= '~')) |
| 495 | { |
| 496 | ++str; |
| 497 | } |
| 498 | |
| 499 | /* Not zero, or not increased */ |
| 500 | if (*str != '\0' || str == str_start) |
| 501 | { |
| 502 | return RT_FALSE; |
| 503 | } |
| 504 | |
| 505 | /* Next string */ |
| 506 | ++str; |
| 507 | } |
| 508 | |
| 509 | return RT_TRUE; |
| 510 | } |
| 511 | |
| 512 | static void ofw_node_dump_dts(struct rt_ofw_node *np, rt_bool_t sibling_too) |
| 513 | { |