lkml.org 
[lkml]   [2013]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] drm/tegra: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2013-11-11 07:41    [W:0.069 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site