[2/2] drm/tegra: Use PTR_ERR_OR_ZERO() to simplify code in tegra_gem_create
diff mbox series

Message ID 1574077572-59152-3-git-send-email-zhengbin13@huawei.com
State New
Headers show
Series
  • drm/tegra: Use PTR_ERR_OR_ZERO() to simplify code
Related show

Commit Message

zhengbin Nov. 18, 2019, 11:46 a.m. UTC
Fixes coccicheck warning:

drivers/gpu/drm/tegra/drm.c:350:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 drivers/gpu/drm/tegra/drm.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--
2.7.4

Patch
diff mbox series

diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 56e5e7a..8b6a1f7d 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,