summaryrefslogtreecommitdiff
path: root/libfdt/fdt_ro.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-02-12 14:45:12 +0900
committerDavid Gibson <david@gibson.dropbear.id.au>2016-02-20 11:29:14 +1100
commit53bf130b1cdd7f6262eedd5e1b224c18bf7f1498 (patch)
treeaf67d921435af93a31379fe5a35090dd3ff93f6a /libfdt/fdt_ro.c
parentc9d9121683b35281239305e15adddfff2b462cf9 (diff)
downloaddevice-tree-compiler-53bf130b1cdd7f6262eedd5e1b224c18bf7f1498.tar.gz
libfdt: simplify fdt_node_check_compatible()
Because fdt_stringlist_contains() returns 1 or 0, fdt_node_check_compatible() can just return the inverted value. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'libfdt/fdt_ro.c')
-rw-r--r--libfdt/fdt_ro.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
index e5b3136..50cce86 100644
--- a/libfdt/fdt_ro.c
+++ b/libfdt/fdt_ro.c
@@ -647,10 +647,8 @@ int fdt_node_check_compatible(const void *fdt, int nodeoffset,
prop = fdt_getprop(fdt, nodeoffset, "compatible", &len);
if (!prop)
return len;
- if (fdt_stringlist_contains(prop, len, compatible))
- return 0;
- else
- return 1;
+
+ return !fdt_stringlist_contains(prop, len, compatible);
}
int fdt_node_offset_by_compatible(const void *fdt, int startoffset,