diff mbox

GPU-DRM-OMAP: Delete unnecessary checks before two function calls

Message ID 54D28E5C.9040304@users.sourceforge.net (mailing list archive)
State New, archived
Headers show

Commit Message

SF Markus Elfring Feb. 4, 2015, 9:25 p.m. UTC
From: Markus Elfring <elfring@users.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@users.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 mbox

Patch

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 */