On Fri, Feb 12, 2016 at 02:45:12PM +0900, Masahiro Yamada wrote: > 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@xxxxxxxxxxxxx> Applied, thanks. > --- > > libfdt/fdt_ro.c | 6 ++---- > 1 file 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, -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Attachment:
signature.asc
Description: PGP signature