]> git.ozlabs.org Git - ccan/commitdiff
agar: Remove unnecessary NULL check
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 4 Apr 2017 13:46:44 +0000 (23:46 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 5 Apr 2017 12:05:22 +0000 (22:05 +1000)
At this point the construction of the function above means that nn cannot
be NULL.

Found by Coverity Scan.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccan/agar/agar.c

index aa4628404864affe29578122fb69f729f1a059c8..0baab325b58e678ba108e3fa2a09257ca92b6d86 100644 (file)
@@ -59,7 +59,7 @@ static struct aga_node *nr_to_n(struct agar_state *sr, const void *nr)
                assert(rc);
        }
 
-       return nn ? &nn->n : NULL;
+       return &nn->n;
 }
 
 static const void *n_to_nr(struct agar_state *sr, const struct aga_node *n)