Browse Source

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>
main
Masahiro Yamada 9 years ago committed by David Gibson
parent
commit
53bf130b1c
  1. 6
      libfdt/fdt_ro.c

6
libfdt/fdt_ro.c

@ -647,10 +647,8 @@ int fdt_node_check_compatible(const void *fdt, int nodeoffset, @@ -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,

Loading…
Cancel
Save