FROMLIST: binder: remove dead code in binder_get_ref_for_node
authorTodd Kjos <tkjos@google.com>
Tue, 2 May 2017 00:21:51 +0000 (17:21 -0700)
committerDanny Wood <danwood76@gmail.com>
Tue, 26 Feb 2019 11:36:31 +0000 (11:36 +0000)
(from https://patchwork.kernel.org/patch/9817819/)

node is always non-NULL in binder_get_ref_for_node so the
conditional and else clause are not needed

Change-Id: I23f011ba59e1869d9577e6bf28e1f1dd38f45713
Signed-off-by: Todd Kjos <tkjos@google.com>
drivers/android/binder.c

index 1961f30d14f1e10d5b7d4252dcba1e7563cb64a2..9c9a9c74f50f45e45778a2d9177e82921924ed2a 100644 (file)
@@ -671,18 +671,12 @@ static struct binder_ref *binder_get_ref_for_node(struct binder_proc *proc,
        }
        rb_link_node(&new_ref->rb_node_desc, parent, p);
        rb_insert_color(&new_ref->rb_node_desc, &proc->refs_by_desc);
-       if (node) {
-               hlist_add_head(&new_ref->node_entry, &node->refs);
+       hlist_add_head(&new_ref->node_entry, &node->refs);
 
-               binder_debug(BINDER_DEBUG_INTERNAL_REFS,
-                            "%d new ref %d desc %d for node %d\n",
-                             proc->pid, new_ref->debug_id, new_ref->desc,
-                             node->debug_id);
-       } else {
-               binder_debug(BINDER_DEBUG_INTERNAL_REFS,
-                            "%d new ref %d desc %d for dead node\n",
-                             proc->pid, new_ref->debug_id, new_ref->desc);
-       }
+       binder_debug(BINDER_DEBUG_INTERNAL_REFS,
+                    "%d new ref %d desc %d for node %d\n",
+                     proc->pid, new_ref->debug_id, new_ref->desc,
+                     node->debug_id);
        return new_ref;
 }