| 690 | } |
| 691 | |
| 692 | const char *fdt_stringlist_get(const void *fdt, int nodeoffset, |
| 693 | const char *property, int idx, |
| 694 | int *lenp) |
| 695 | { |
| 696 | const char *list, *end; |
| 697 | int length; |
| 698 | |
| 699 | list = fdt_getprop(fdt, nodeoffset, property, &length); |
| 700 | if (!list) { |
| 701 | if (lenp) |
| 702 | *lenp = length; |
| 703 | |
| 704 | return NULL; |
| 705 | } |
| 706 | |
| 707 | end = list + length; |
| 708 | |
| 709 | while (list < end) { |
| 710 | length = strnlen(list, end - list) + 1; |
| 711 | |
| 712 | /* Abort if the last string isn't properly NUL-terminated. */ |
| 713 | if (list + length > end) { |
| 714 | if (lenp) |
| 715 | *lenp = -FDT_ERR_BADVALUE; |
| 716 | |
| 717 | return NULL; |
| 718 | } |
| 719 | |
| 720 | if (idx == 0) { |
| 721 | if (lenp) |
| 722 | *lenp = length - 1; |
| 723 | |
| 724 | return list; |
| 725 | } |
| 726 | |
| 727 | list += length; |
| 728 | idx--; |
| 729 | } |
| 730 | |
| 731 | if (lenp) |
| 732 | *lenp = -FDT_ERR_NOTFOUND; |
| 733 | |
| 734 | return NULL; |
| 735 | } |
| 736 | |
| 737 | int fdt_node_check_compatible(const void *fdt, int nodeoffset, |
| 738 | const char *compatible) |
nothing calls this directly
no test coverage detected