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

Function fdt_next_node

freebsd/contrib/libfdt/fdt.c:165–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165int fdt_next_node(const void *fdt, int offset, int *depth)
166{
167 int nextoffset = 0;
168 uint32_t tag;
169
170 if (offset >= 0)
171 if ((nextoffset = fdt_check_node_offset_(fdt, offset)) < 0)
172 return nextoffset;
173
174 do {
175 offset = nextoffset;
176 tag = fdt_next_tag(fdt, offset, &nextoffset);
177
178 switch (tag) {
179 case FDT_PROP:
180 case FDT_NOP:
181 break;
182
183 case FDT_BEGIN_NODE:
184 if (depth)
185 (*depth)++;
186 break;
187
188 case FDT_END_NODE:
189 if (depth && ((--(*depth)) < 0))
190 return nextoffset;
191 break;
192
193 case FDT_END:
194 if ((nextoffset >= 0)
195 || ((nextoffset == -FDT_ERR_TRUNCATED) && !depth))
196 return -FDT_ERR_NOTFOUND;
197 else
198 return nextoffset;
199 }
200 } while (tag != FDT_BEGIN_NODE);
201
202 return offset;
203}
204
205int fdt_first_subnode(const void *fdt, int offset)
206{

Callers 10

fdt_get_max_phandleFunction · 0.85
fdt_get_pathFunction · 0.85
fdt_node_end_offset_Function · 0.85
fdt_first_subnodeFunction · 0.85
fdt_next_subnodeFunction · 0.85

Calls 2

fdt_check_node_offset_Function · 0.85
fdt_next_tagFunction · 0.85

Tested by

no test coverage detected