Skip to content

Commit c46ca3c

Browse files
elfringglikely
authored andcommitted
of: Delete unnecessary check before calling "of_node_put()"
The of_node_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <[email protected]> Signed-off-by: Grant Likely <[email protected]>
1 parent 70161ff commit c46ca3c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/of/unittest.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,7 @@ static void __init of_selftest_changeset(void)
516516
/* Make sure node names are constructed correctly */
517517
selftest((np = of_find_node_by_path("/testcase-data/changeset/n2/n21")),
518518
"'%s' not added\n", n21->full_name);
519-
if (np)
520-
of_node_put(np);
519+
of_node_put(np);
521520

522521
mutex_lock(&of_mutex);
523522
selftest(!of_changeset_revert(&chgset), "revert failed\n");

0 commit comments

Comments
 (0)