From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.web.de (mout.web.de [212.227.15.4]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rvd3h55GhzDqTj for ; Wed, 20 Jul 2016 23:26:40 +1000 (AEST) Subject: [PATCH] cxl: Delete an unnecessary check before the function call "of_node_put" To: linuxppc-dev@lists.ozlabs.org, Christophe Lombard , Ian Munsie References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall , Michael Ellerman From: SF Markus Elfring Message-ID: <33fb6b04-9986-35ee-f4e2-0ebeb79c5e23@users.sourceforge.net> Date: Wed, 20 Jul 2016 15:20:59 +0200 MIME-Version: 1.0 In-Reply-To: <5317A59D.4@users.sourceforge.net> Content-Type: text/plain; charset=windows-1252 List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Markus Elfring Date: Wed, 20 Jul 2016 15:10:32 +0200 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 --- drivers/misc/cxl/of.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/misc/cxl/of.c b/drivers/misc/cxl/of.c index edc4583..333256a 100644 --- a/drivers/misc/cxl/of.c +++ b/drivers/misc/cxl/of.c @@ -490,8 +490,7 @@ int cxl_of_probe(struct platform_device *pdev) adapter->slices = 0; } - if (afu_np) - of_node_put(afu_np); + of_node_put(afu_np); return 0; } -- 2.9.2