[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54D28E5C.9040304@users.sourceforge.net>
Date: Wed, 04 Feb 2015 22:25:48 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: David Airlie <airlied@...ux.ie>, dri-devel@...ts.freedesktop.org
CC: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH] GPU-DRM-OMAP: Delete unnecessary checks before two function
calls
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 4 Feb 2015 22:22:36 +0100
The functions framebuffer_release() and vunmap() perform also input
parameter validation. Thus the test around their calls is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/gpu/drm/omapdrm/omap_fbdev.c | 3 +--
drivers/gpu/drm/omapdrm/omap_gem.c | 5 ++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index d292d24..fcc02b0 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -270,8 +270,7 @@ fail_unlock:
fail:
if (ret) {
- if (fbi)
- framebuffer_release(fbi);
+ framebuffer_release(fbi);
if (fb) {
drm_framebuffer_unregister_private(fb);
drm_framebuffer_remove(fb);
diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c
index aeb91ed..18a4137 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -1292,12 +1292,11 @@ void omap_gem_free_object(struct drm_gem_object *obj)
if (omap_obj->pages)
omap_gem_detach_pages(obj);
- if (!is_shmem(obj)) {
+ if (!is_shmem(obj))
dma_free_writecombine(dev->dev, obj->size,
omap_obj->vaddr, omap_obj->paddr);
- } else if (omap_obj->vaddr) {
+ else
vunmap(omap_obj->vaddr);
- }
}
/* don't free externally allocated syncobj */
--
2.2.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists