From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756701AbaHHKpg (ORCPT ); Fri, 8 Aug 2014 06:45:36 -0400 Received: from mail-bl2lp0212.outbound.protection.outlook.com ([207.46.163.212]:28746 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756632AbaHHKpY (ORCPT ); Fri, 8 Aug 2014 06:45:24 -0400 Date: Fri, 8 Aug 2014 12:44:59 +0200 From: Michal Simek User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Julia Lawall , Anirudha Sarangi CC: , John Linn , Michal Simek , , , , =?UTF-8?B?VXdlIEtsZWluZS1Lw7ZuaWc=?= Subject: Re: [PATCH 2/14] net: axienet: delete unneeded test before of_node_put References: <1407492475-26283-2-git-send-email-Julia.Lawall@lip6.fr> In-Reply-To: <1407492475-26283-2-git-send-email-Julia.Lawall@lip6.fr> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-RCIS-Action: ALLOW X-imss-version: 2.032 X-imss-result: Passed X-imss-scanInfo: M:P L:N SM:0 X-imss-tmaseResult: TT:0 TS:0.0000 TC:00 TRN:0 TV:3.51.1032(14006.000) X-imss-scores: Clean:99.90000 C:2 M:3 S:5 R:5 X-imss-settings: Baseline:1 C:1 M:1 S:1 R:1 (0.0000 0.0000) Message-ID: <982aa979-17f6-4f7d-af29-084c2f263652@BY2FFO11FD060.protection.gbl> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:62.221.5.235;CTRY:GB;IPV:NLI;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009004)(6009001)(438002)(51704005)(164054003)(24454002)(479174003)(189002)(377454003)(199002)(99396002)(15975445006)(83506001)(76176999)(50466002)(54356999)(50986999)(85852003)(83072002)(23676002)(87936001)(102836001)(575784001)(31696002)(1496007)(4396001)(92726001)(86362001)(74662001)(74502001)(104016003)(21056001)(65806001)(80022001)(19580395003)(44976005)(6806004)(107046002)(83322001)(19580405001)(64706001)(85306004)(74316001)(81542001)(76482001)(20776003)(79102001)(15202345003)(47776003)(46102001)(81342001)(70736001)(77982001)(95666004)(106466001)(65826006)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2FFO11HUB060;H:xir-pvapsmtpgw01;FPR:;MLV:sfv;PTR:unknown-62-221-5-235.ipspace.xilinx.com;MX:1;A:1;LANG:en; X-OriginatorOrg: xilinx.onmicrosoft.com X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 02973C87BC Authentication-Results: spf=pass (sender IP is 62.221.5.235) smtp.mailfrom=michal.simek@xilinx.com; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/08/2014 12:07 PM, Julia Lawall wrote: > From: Julia Lawall > > Of_node_put supports NULL as its argument, so the initial test is not > necessary. > > Suggested by Uwe Kleine-König. > > The semantic patch that fixes this problem is as follows: > (http://coccinelle.lip6.fr/) > > // > @@ > expression e; > @@ > > -if (e) > of_node_put(e); > // > > Signed-off-by: Julia Lawall > > --- > drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c > index 7b0a735..30e8608 100644 > --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c > +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c > @@ -1630,8 +1630,7 @@ static int axienet_of_remove(struct platform_device *op) > axienet_mdio_teardown(lp); > unregister_netdev(ndev); > > - if (lp->phy_node) > - of_node_put(lp->phy_node); > + of_node_put(lp->phy_node); > lp->phy_node = NULL; > > iounmap(lp->regs); > Reviewed-by: Michal Simek Thanks, Michal From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Simek Subject: Re: [PATCH 2/14] net: axienet: delete unneeded test before of_node_put Date: Fri, 8 Aug 2014 12:44:59 +0200 Message-ID: <982aa979-17f6-4f7d-af29-084c2f263652@BY2FFO11FD060.protection.gbl> References: <1407492475-26283-2-git-send-email-Julia.Lawall@lip6.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: , John Linn , Michal Simek , , , , =?UTF-8?B?VXdlIEtsZWluZS1Lw7ZuaWc=?= To: Julia Lawall , Anirudha Sarangi Return-path: In-Reply-To: <1407492475-26283-2-git-send-email-Julia.Lawall@lip6.fr> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On 08/08/2014 12:07 PM, Julia Lawall wrote: > From: Julia Lawall >=20 > Of_node_put supports NULL as its argument, so the initial test is not > necessary. >=20 > Suggested by Uwe Kleine-K=C3=B6nig. >=20 > The semantic patch that fixes this problem is as follows: > (http://coccinelle.lip6.fr/) >=20 > // > @@ > expression e; > @@ >=20 > -if (e) > of_node_put(e); > // >=20 > Signed-off-by: Julia Lawall >=20 > --- > drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/driv= ers/net/ethernet/xilinx/xilinx_axienet_main.c > index 7b0a735..30e8608 100644 > --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c > +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c > @@ -1630,8 +1630,7 @@ static int axienet_of_remove(struct platform_de= vice *op) > axienet_mdio_teardown(lp); > unregister_netdev(ndev); > =20 > - if (lp->phy_node) > - of_node_put(lp->phy_node); > + of_node_put(lp->phy_node); > lp->phy_node =3D NULL; > =20 > iounmap(lp->regs); >=20 Reviewed-by: Michal Simek Thanks, Michal From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Simek Date: Fri, 08 Aug 2014 10:44:59 +0000 Subject: Re: [PATCH 2/14] net: axienet: delete unneeded test before of_node_put Message-Id: <982aa979-17f6-4f7d-af29-084c2f263652@BY2FFO11FD060.protection.gbl> List-Id: References: <1407492475-26283-2-git-send-email-Julia.Lawall@lip6.fr> In-Reply-To: <1407492475-26283-2-git-send-email-Julia.Lawall@lip6.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-arm-kernel@lists.infradead.org On 08/08/2014 12:07 PM, Julia Lawall wrote: > From: Julia Lawall >=20 > Of_node_put supports NULL as its argument, so the initial test is not > necessary. >=20 > Suggested by Uwe Kleine-K=C3=B6nig. >=20 > The semantic patch that fixes this problem is as follows: > (http://coccinelle.lip6.fr/) >=20 > // > @@ > expression e; > @@ >=20 > -if (e) > of_node_put(e); > // >=20 > Signed-off-by: Julia Lawall >=20 > --- > drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/= net/ethernet/xilinx/xilinx_axienet_main.c > index 7b0a735..30e8608 100644 > --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c > +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c > @@ -1630,8 +1630,7 @@ static int axienet_of_remove(struct platform_device= *op) > axienet_mdio_teardown(lp); > unregister_netdev(ndev); > =20 > - if (lp->phy_node) > - of_node_put(lp->phy_node); > + of_node_put(lp->phy_node); > lp->phy_node =3D NULL; > =20 > iounmap(lp->regs); >=20 Reviewed-by: Michal Simek Thanks, Michal -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: michal.simek@xilinx.com (Michal Simek) Date: Fri, 8 Aug 2014 12:44:59 +0200 Subject: [PATCH 2/14] net: axienet: delete unneeded test before of_node_put In-Reply-To: <1407492475-26283-2-git-send-email-Julia.Lawall@lip6.fr> References: <1407492475-26283-2-git-send-email-Julia.Lawall@lip6.fr> Message-ID: <982aa979-17f6-4f7d-af29-084c2f263652@BY2FFO11FD060.protection.gbl> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 08/08/2014 12:07 PM, Julia Lawall wrote: > From: Julia Lawall > > Of_node_put supports NULL as its argument, so the initial test is not > necessary. > > Suggested by Uwe Kleine-K?nig. > > The semantic patch that fixes this problem is as follows: > (http://coccinelle.lip6.fr/) > > // > @@ > expression e; > @@ > > -if (e) > of_node_put(e); > // > > Signed-off-by: Julia Lawall > > --- > drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c > index 7b0a735..30e8608 100644 > --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c > +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c > @@ -1630,8 +1630,7 @@ static int axienet_of_remove(struct platform_device *op) > axienet_mdio_teardown(lp); > unregister_netdev(ndev); > > - if (lp->phy_node) > - of_node_put(lp->phy_node); > + of_node_put(lp->phy_node); > lp->phy_node = NULL; > > iounmap(lp->regs); > Reviewed-by: Michal Simek Thanks, Michal