Merge tag 'backlight-next-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / scripts / dtc / livetree.c
index 7eacd02..cc61237 100644 (file)
@@ -526,7 +526,7 @@ struct node *get_node_by_path(struct node *tree, const char *path)
        p = strchr(path, '/');
 
        for_each_child(tree, child) {
-               if (p && strprefixeq(path, p - path, child->name))
+               if (p && strprefixeq(path, (size_t)(p - path), child->name))
                        return get_node_by_path(child, p+1);
                else if (!p && streq(path, child->name))
                        return child;
@@ -559,7 +559,7 @@ struct node *get_node_by_phandle(struct node *tree, cell_t phandle)
 {
        struct node *child, *node;
 
-       if ((phandle == 0) || (phandle == -1)) {
+       if (!phandle_is_valid(phandle)) {
                assert(generate_fixups);
                return NULL;
        }
@@ -594,7 +594,7 @@ cell_t get_node_phandle(struct node *root, struct node *node)
        static cell_t phandle = 1; /* FIXME: ick, static local */
        struct data d = empty_data;
 
-       if ((node->phandle != 0) && (node->phandle != -1))
+       if (phandle_is_valid(node->phandle))
                return node->phandle;
 
        while (get_node_by_phandle(root, phandle))