Message ID | 1608015653-37527-1-git-send-email-tiantao6@hisilicon.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/tegra: Use PTR_ERR_OR_ZERO() to simplify code | expand |
On Tue, Dec 15, 2020 at 03:00:53PM +0800, Tian Tao wrote: > Fixes coccicheck warning: > drivers/gpu/drm/tegra/drm.c:350:1-3: WARNING: PTR_ERR_OR_ZERO can be used > > Signed-off-by: Tian Tao <tiantao6@hisilicon.com> > --- > drivers/gpu/drm/tegra/drm.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) This coccinelle patch was recently removed, so I won't pick this up. Thierry
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 19ffb06..245b468 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -347,10 +347,7 @@ static int tegra_gem_create(struct drm_device *drm, void *data, bo = tegra_bo_create_with_handle(file, drm, args->size, args->flags, &args->handle); - if (IS_ERR(bo)) - return PTR_ERR(bo); - - return 0; + return PTR_ERR_OR_ZERO(bo); } static int tegra_gem_mmap(struct drm_device *drm, void *data,
Fixes coccicheck warning: drivers/gpu/drm/tegra/drm.c:350:1-3: WARNING: PTR_ERR_OR_ZERO can be used Signed-off-by: Tian Tao <tiantao6@hisilicon.com> --- drivers/gpu/drm/tegra/drm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)