All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Cc: Duan Jiong <duanj.fnst-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>,
	"kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org"
	<kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	"linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org"
	<linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	"a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org"
	<a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org>,
	"airlied-cv59FeDIM0c@public.gmane.org"
	<airlied-cv59FeDIM0c@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org"
	<rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>,
	"dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Terje Bergstrom
	<tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH] drm/tegra: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
Date: Mon, 11 Nov 2013 07:23:39 +0100	[thread overview]
Message-ID: <20131111062339.GB13878@ulmo.nvidia.com> (raw)
In-Reply-To: <527A7333.9090409-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 941 bytes --]

On Wed, Nov 06, 2013 at 05:49:55PM +0100, Stephen Warren wrote:
> On 11/06/2013 12:53 AM, Duan Jiong wrote:
> > This patch fixes coccinelle error regarding usage of IS_ERR and
> > PTR_ERR instead of PTR_ERR_OR_ZERO.
> 
> > diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
> 
> > @@ -199,10 +199,7 @@ int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm,
> >  
> >  	bo = tegra_bo_create_with_handle(file, drm, args->size, 0,
> >  					 &args->handle);
> > -	if (IS_ERR(bo))
> > -		return PTR_ERR(bo);
> > -
> > -	return 0;
> > +	return PTR_ERR_OR_ZERO(bo);
> >  }
> 
> I suppose that's fine, although I wonder if it'll cause churn should we
> ever need to add code to the tail end of the function.

It's unlikely that we'll ever need to add to this function. But I'm not
a big fan of PTR_ERR_OR_ZERO to be honest, so I'll let this sink in for
a bit before applying.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Thierry Reding <treding@nvidia.com>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: Duan Jiong <duanj.fnst@cn.fujitsu.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
	"a.zummo@towertech.it" <a.zummo@towertech.it>,
	"airlied@linux.ie" <airlied@linux.ie>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"rtc-linux@googlegroups.com" <rtc-linux@googlegroups.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	Terje Bergstrom <tbergstrom@nvidia.com>
Subject: Re: [PATCH] drm/tegra: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
Date: Mon, 11 Nov 2013 07:23:39 +0100	[thread overview]
Message-ID: <20131111062339.GB13878@ulmo.nvidia.com> (raw)
In-Reply-To: <527A7333.9090409@wwwdotorg.org>

[-- Attachment #1: Type: text/plain, Size: 941 bytes --]

On Wed, Nov 06, 2013 at 05:49:55PM +0100, Stephen Warren wrote:
> On 11/06/2013 12:53 AM, Duan Jiong wrote:
> > This patch fixes coccinelle error regarding usage of IS_ERR and
> > PTR_ERR instead of PTR_ERR_OR_ZERO.
> 
> > diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
> 
> > @@ -199,10 +199,7 @@ int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm,
> >  
> >  	bo = tegra_bo_create_with_handle(file, drm, args->size, 0,
> >  					 &args->handle);
> > -	if (IS_ERR(bo))
> > -		return PTR_ERR(bo);
> > -
> > -	return 0;
> > +	return PTR_ERR_OR_ZERO(bo);
> >  }
> 
> I suppose that's fine, although I wonder if it'll cause churn should we
> ever need to add code to the tail end of the function.

It's unlikely that we'll ever need to add to this function. But I'm not
a big fan of PTR_ERR_OR_ZERO to be honest, so I'll let this sink in for
a bit before applying.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2013-11-11  6:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-06  7:53 [PATCH] drm/tegra: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO Duan Jiong
2013-11-06 16:49 ` Stephen Warren
     [not found]   ` <527A7333.9090409-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-11-07  1:15     ` Duan Jiong
2013-11-07  1:15       ` Duan Jiong
2013-11-11  6:23     ` Thierry Reding [this message]
2013-11-11  6:23       ` Thierry Reding
  -- strict thread matches above, loose matches on Subject: below --
2014-04-11  8:36 Duan Jiong
     [not found] ` <1397205401-24148-1-git-send-email-duanj.fnst-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2014-04-11 15:48   ` Stephen Warren
2014-04-16 19:49     ` Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131111062339.GB13878@ulmo.nvidia.com \
    --to=treding-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
    --cc=a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org \
    --cc=airlied-cv59FeDIM0c@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=duanj.fnst-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
    --cc=tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.