summaryrefslogtreecommitdiff
path: root/tests/subnode_iterate.c
diff options
context:
space:
mode:
authorOleksandr Tymoshenko <gonzo@FreeBSD.org>2017-03-10 03:28:43 +0000
committerOleksandr Tymoshenko <gonzo@FreeBSD.org>2017-03-10 03:28:43 +0000
commitf059bd1ebfc4cf2e96c4639ad7fa6cf3a3198a2f (patch)
tree74d52c3db99ba80520d6142e9bc77e2802093021 /tests/subnode_iterate.c
parentb903311b940763cafe4fb3d8ab3da9c135c17b0c (diff)
Import dtc 1.4.3vendor/dtc/1.4.3
Notes
svn path=/vendor/dtc/dist/; revision=314985 svn path=/vendor/dtc/1.4.3/; revision=314986; tag=vendor/dtc/1.4.3
Diffstat (limited to 'tests/subnode_iterate.c')
-rw-r--r--tests/subnode_iterate.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/subnode_iterate.c b/tests/subnode_iterate.c
index b9f379d5963c..0fb5c901ebd7 100644
--- a/tests/subnode_iterate.c
+++ b/tests/subnode_iterate.c
@@ -48,9 +48,7 @@ static void test_node(void *fdt, int parent_offset)
subnodes = cpu_to_fdt32(*prop);
count = 0;
- for (offset = fdt_first_subnode(fdt, parent_offset);
- offset >= 0;
- offset = fdt_next_subnode(fdt, offset))
+ fdt_for_each_subnode(offset, fdt, parent_offset)
count++;
if (count != subnodes) {
@@ -65,9 +63,7 @@ static void check_fdt_next_subnode(void *fdt)
int offset;
int count = 0;
- for (offset = fdt_first_subnode(fdt, 0);
- offset >= 0;
- offset = fdt_next_subnode(fdt, offset)) {
+ fdt_for_each_subnode(offset, fdt, 0) {
test_node(fdt, offset);
count++;
}