of: Delete an unnecessary check before the function call "of_node_put"
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 19 Jul 2016 20:42:22 +0000 (22:42 +0200)
committerRob Herring <robh@kernel.org>
Tue, 9 Aug 2016 17:36:27 +0000 (12:36 -0500)
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 <elfring@users.sourceforge.net>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/base.c

index 7792266db2597b29f8158d87fdb61904eec64fe4..cb255a07baa0f8c682f15f82f0c36e22052fa754 100644 (file)
@@ -1631,8 +1631,7 @@ static int __of_parse_phandle_with_args(const struct device_node *np,
         */
 
  err:
-       if (it.node)
-               of_node_put(it.node);
+       of_node_put(it.node);
        return rc;
 }