[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190525070353.GA6727@hari-Inspiron-1545>
Date: Sat, 25 May 2019 12:33:53 +0530
From: Hariprasad Kelam <hariprasad.kelam@...il.com>
To: Thierry Reding <thierry.reding@...il.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Jonathan Hunter <jonathanh@...dia.com>,
dri-devel@...ts.freedesktop.org, linux-tegra@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] drm/tegra: fix warning PTR_ERR_OR_ZERO can be used
fix below warnings reported by coccicheck
/drivers/gpu/drm/tegra/drm.c:509:1-3: WARNING: PTR_ERR_OR_ZERO can be
used
./drivers/gpu/drm/tegra/gem.c:419:1-3: WARNING: PTR_ERR_OR_ZERO can be
used
Signed-off-by: Hariprasad Kelam <hariprasad.kelam@...il.com>
---
drivers/gpu/drm/tegra/drm.c | 6 ++----
drivers/gpu/drm/tegra/gem.c | 5 +----
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 0c5f1e6..0a8fcc1 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -506,10 +506,8 @@ 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,
diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
index 4cce11f..6e27fc0 100644
--- a/drivers/gpu/drm/tegra/gem.c
+++ b/drivers/gpu/drm/tegra/gem.c
@@ -416,10 +416,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);
}
static vm_fault_t tegra_bo_fault(struct vm_fault *vmf)
--
2.7.4
Powered by blists - more mailing lists