Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759408Ab3CZEzy (ORCPT ); Tue, 26 Mar 2013 00:55:54 -0400 Received: from ozlabs.org ([203.10.76.45]:60032 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756905Ab3CZEzx (ORCPT ); Tue, 26 Mar 2013 00:55:53 -0400 From: Rusty Russell To: Alexandru Gheorghiu Cc: "Michael S. Tsirkin" , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Alexandru Gheorghiu , Uwe =?utf-8?Q?Kleine-K?= =?utf-8?Q?=C3=B6nig?= , "Andrew Morton" Subject: Re: [PATCH] drivers: virtio: Use PTR_RET function In-Reply-To: <1364217936-6284-1-git-send-email-gheorghiuandru@gmail.com> References: <1364217936-6284-1-git-send-email-gheorghiuandru@gmail.com> User-Agent: Notmuch/0.14 (http://notmuchmail.org) Emacs/23.4.1 (i686-pc-linux-gnu) Date: Tue, 26 Mar 2013 13:57:09 +1030 Message-ID: <87fvzidenm.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1491 Lines: 47 Alexandru Gheorghiu writes: > Used PTR_RET function instead of IS_ERR and PTR_ERR. > Patch found using coccinelle. WTF is PTR_RET? PTR_RET doesn't return anything. Why is it called that? It doesn't even make sense. ZERO_OR_PTR_ERR() maybe. But what problem are we solving? Insufficient churn in the tree? Code being too readable? This isn't some hard-to-get right corner case, or a missed optimization. Andrew, what am I missing here? Grumpy, Rusty. > Signed-off-by: Alexandru Gheorghiu > --- > drivers/virtio/virtio_mmio.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c > index 1ba0d68..d1e664f 100644 > --- a/drivers/virtio/virtio_mmio.c > +++ b/drivers/virtio/virtio_mmio.c > @@ -567,10 +567,7 @@ static int vm_cmdline_set(const char *device, > pdev = platform_device_register_resndata(&vm_cmdline_parent, > "virtio-mmio", vm_cmdline_id++, > resources, ARRAY_SIZE(resources), NULL, 0); > - if (IS_ERR(pdev)) > - return PTR_ERR(pdev); > - > - return 0; > + return PTR_RET(pdev); > } > > static int vm_cmdline_get_device(struct device *dev, void *data) > -- > 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/