MCPcopy Create free account
hub / github.com/F-Stack/f-stack / get_path_len

Function get_path_len

freebsd/contrib/libfdt/fdt_overlay.c:695–721  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

693}
694
695static int get_path_len(const void *fdt, int nodeoffset)
696{
697 int len = 0, namelen;
698 const char *name;
699
700 FDT_CHECK_HEADER(fdt);
701
702 for (;;) {
703 name = fdt_get_name(fdt, nodeoffset, &namelen);
704 if (!name)
705 return namelen;
706
707 /* root? we're done */
708 if (namelen == 0)
709 break;
710
711 nodeoffset = fdt_parent_offset(fdt, nodeoffset);
712 if (nodeoffset < 0)
713 return nodeoffset;
714 len += namelen + 1;
715 }
716
717 /* in case of root pretend it's "/" */
718 if (len == 0)
719 len++;
720 return len;
721}
722
723/**
724 * overlay_symbol_update - Update the symbols of base tree after a merge

Callers 1

overlay_symbol_updateFunction · 0.85

Calls 2

fdt_get_nameFunction · 0.85
fdt_parent_offsetFunction · 0.85

Tested by

no test coverage detected