From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.web.de (mout.web.de [212.227.17.12]) (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 C8F051A01CC for ; Tue, 30 Jun 2015 18:19:28 +1000 (AEST) Message-ID: <55924FC2.3070006@users.sourceforge.net> Date: Tue, 30 Jun 2015 10:13:54 +0200 From: SF Markus Elfring MIME-Version: 1.0 To: Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org CC: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: Re: [PATCH] macintosh: Delete an unnecessary check before the function call "of_node_put" 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> <54D282B0.90907@users.sourceforge.net> In-Reply-To: <54D282B0.90907@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Am 04.02.2015 um 21:36 schrieb SF Markus Elfring: > From: Markus Elfring > Date: Wed, 4 Feb 2015 21:32:27 +0100 > > 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/macintosh/smu.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c > index 10ae69b..d531f80 100644 > --- a/drivers/macintosh/smu.c > +++ b/drivers/macintosh/smu.c > @@ -557,8 +557,7 @@ int __init smu_init (void) > return 0; > > fail_msg_node: > - if (smu->msg_node) > - of_node_put(smu->msg_node); > + of_node_put(smu->msg_node); > fail_db_node: > of_node_put(smu->db_node); > fail_bootmem: > Would you like to integrate this update suggestion into another source code repository? Regards, Markus