linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/tegra: Use PTR_ERR_OR_ZERO() to simplify code
@ 2020-12-15  7:00 Tian Tao
  2021-01-15 16:23 ` Thierry Reding
  0 siblings, 1 reply; 2+ messages in thread
From: Tian Tao @ 2020-12-15  7:00 UTC (permalink / raw)
  To: thierry.reding, airlied, daniel, jonathanh; +Cc: dri-devel, linux-tegra

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(-)

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,
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/tegra: Use PTR_ERR_OR_ZERO() to simplify code
  2020-12-15  7:00 [PATCH] drm/tegra: Use PTR_ERR_OR_ZERO() to simplify code Tian Tao
@ 2021-01-15 16:23 ` Thierry Reding
  0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2021-01-15 16:23 UTC (permalink / raw)
  To: Tian Tao; +Cc: airlied, daniel, jonathanh, dri-devel, linux-tegra

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

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-15 16:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15  7:00 [PATCH] drm/tegra: Use PTR_ERR_OR_ZERO() to simplify code Tian Tao
2021-01-15 16:23 ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).