[{"id":1424014,"web_url":"http://patchwork.ozlabs.org/comment/1424014/","msgid":"<20160804131600.bd2f72d2a0a6d8deec0af79b@linux-foundation.org>","date":"2016-08-04T20:16:00","subject":"Re: [patch] powerpc/fsl_rio: fix a missing error code","submitter":{"id":107,"url":"http://patchwork.ozlabs.org/api/people/107/","name":"Andrew Morton","email":"akpm@linux-foundation.org"},"content":"On Thu, 4 Aug 2016 08:35:25 +0300 Dan Carpenter <dan.carpenter@oracle.com> wrote:\n\n> We should set the error code here.  Otherwise static checkers complain.\n> \n\nhm.\n\n> --- a/arch/powerpc/sysdev/fsl_rio.c\n> +++ b/arch/powerpc/sysdev/fsl_rio.c\n> @@ -491,6 +491,7 @@ int fsl_rio_setup(struct platform_device *dev)\n>  \trmu_node = of_parse_phandle(dev->dev.of_node, \"fsl,srio-rmu-handle\", 0);\n>  \tif (!rmu_node) {\n>  \t\tdev_err(&dev->dev, \"No valid fsl,srio-rmu-handle property\\n\");\n> +\t\trc = -ENOENT;\n>  \t\tgoto err_rmu;\n>  \t}\n>  \trc = of_address_to_resource(rmu_node, 0, &rmu_regs);\n\nafaict the function will return 0 in this case, which is a flat out\nbug.  But why do static checkers complain?  The code will return a\nsuitably initialized value?\n\nIOW, please always quote the checker/compiler output when fixing a bug!","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3s51SG2ylkz9t0Z\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  5 Aug 2016 06:17:02 +1000 (AEST)","from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3s51SG28GRzDqwM\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  5 Aug 2016 06:17:02 +1000 (AEST)","from mail.linuxfoundation.org (mail.linuxfoundation.org\n\t[140.211.169.12])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3s51R74kGkzDqQ1\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri,  5 Aug 2016 06:16:03 +1000 (AEST)","from akpm3.mtv.corp.google.com (unknown [104.132.1.73])\n\tby mail.linuxfoundation.org (Postfix) with ESMTPSA id 540BD957;\n\tThu,  4 Aug 2016 20:16:01 +0000 (UTC)"],"Date":"Thu, 4 Aug 2016 13:16:00 -0700","From":"Andrew Morton <akpm@linux-foundation.org>","To":"Dan Carpenter <dan.carpenter@oracle.com>","Subject":"Re: [patch] powerpc/fsl_rio: fix a missing error code","Message-Id":"<20160804131600.bd2f72d2a0a6d8deec0af79b@linux-foundation.org>","In-Reply-To":"<20160804053525.GM775@mwanda>","References":"<20160804053525.GM775@mwanda>","X-Mailer":"Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu)","Mime-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","Content-Transfer-Encoding":"7bit","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.22","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"kernel-janitors@vger.kernel.org,\n\tAlexandre Bounine <alexandre.bounine@idt.com>,\n\tPaul Mackerras <paulus@samba.org>, linuxppc-dev@lists.ozlabs.org","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":1424839,"web_url":"http://patchwork.ozlabs.org/comment/1424839/","msgid":"<20160805202815.GB4186@mwanda>","date":"2016-08-05T20:28:16","subject":"Re: [patch] powerpc/fsl_rio: fix a missing error code","submitter":{"id":9327,"url":"http://patchwork.ozlabs.org/api/people/9327/","name":"Dan Carpenter","email":"dan.carpenter@oracle.com"},"content":"On Thu, Aug 04, 2016 at 01:16:00PM -0700, Andrew Morton wrote:\n> On Thu, 4 Aug 2016 08:35:25 +0300 Dan Carpenter <dan.carpenter@oracle.com> wrote:\n> \n> > We should set the error code here.  Otherwise static checkers complain.\n> > \n> \n> hm.\n> \n> > --- a/arch/powerpc/sysdev/fsl_rio.c\n> > +++ b/arch/powerpc/sysdev/fsl_rio.c\n> > @@ -491,6 +491,7 @@ int fsl_rio_setup(struct platform_device *dev)\n> >  \trmu_node = of_parse_phandle(dev->dev.of_node, \"fsl,srio-rmu-handle\", 0);\n> >  \tif (!rmu_node) {\n> >  \t\tdev_err(&dev->dev, \"No valid fsl,srio-rmu-handle property\\n\");\n> > +\t\trc = -ENOENT;\n> >  \t\tgoto err_rmu;\n> >  \t}\n> >  \trc = of_address_to_resource(rmu_node, 0, &rmu_regs);\n> \n> afaict the function will return 0 in this case, which is a flat out\n> bug.  But why do static checkers complain?  The code will return a\n> suitably initialized value?\n> \n> IOW, please always quote the checker/compiler output when fixing a bug!\n\nCoccinelle has a check for missing error codes and I'm working on one\nfor Smatch as well.\n\nregards,\ndan carpenter","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3s5dhz6dJbz9sCy\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat,  6 Aug 2016 06:30:11 +1000 (AEST)","from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3s5dhz6305zDrFR\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat,  6 Aug 2016 06:30:11 +1000 (AEST)","from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3s5dgs1zClzDqWf\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tSat,  6 Aug 2016 06:29:13 +1000 (AEST)","from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233])\n\tby userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2)\n\twith ESMTP id u75KSNJl009470\n\t(version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);\n\tFri, 5 Aug 2016 20:28:24 GMT","from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235])\n\tby aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id\n\tu75KSNlb023731\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);\n\tFri, 5 Aug 2016 20:28:23 GMT","from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21])\n\tby aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id\n\tu75KSLJ1009419; Fri, 5 Aug 2016 20:28:21 GMT","from mwanda (/154.0.139.178) by default (Oracle Beehive Gateway\n\tv4.0) with ESMTP ; Fri, 05 Aug 2016 13:28:20 -0700"],"Date":"Fri, 5 Aug 2016 23:28:16 +0300","From":"Dan Carpenter <dan.carpenter@oracle.com>","To":"Andrew Morton <akpm@linux-foundation.org>","Subject":"Re: [patch] powerpc/fsl_rio: fix a missing error code","Message-ID":"<20160805202815.GB4186@mwanda>","References":"<20160804053525.GM775@mwanda>\n\t<20160804131600.bd2f72d2a0a6d8deec0af79b@linux-foundation.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20160804131600.bd2f72d2a0a6d8deec0af79b@linux-foundation.org>","User-Agent":"Mutt/1.5.21 (2010-09-15)","X-Source-IP":"aserv0021.oracle.com [141.146.126.233]","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.22","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"kernel-janitors@vger.kernel.org,\n\tAlexandre Bounine <alexandre.bounine@idt.com>,\n\tPaul Mackerras <paulus@samba.org>, linuxppc-dev@lists.ozlabs.org","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}}]