GPU-DRM-OMAP: Delete unnecessary checks before two function calls
authorMarkus Elfring <elfring@users.sourceforge.net>
Fri, 22 Jul 2016 06:28:31 +0000 (08:28 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 22 Jul 2016 08:27:59 +0000 (10:27 +0200)
The following functions test whether their argument is NULL and then
return immediately.
* backlight_device_unregister
* drm_gem_object_unreference_unlocked

Thus the test around the calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/72ff4670-4f3d-c7ed-4f37-e49f2bbc7aba@users.sourceforge.net
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
drivers/gpu/drm/omapdrm/omap_fb.c

index 1b0cf2d8224b3ade7cf2aeb124db6e58c5faebf4..0eae8afaed90bb08fe49bf32f3559bb0bec739db 100644 (file)
@@ -1284,8 +1284,7 @@ static int dsicm_probe(struct platform_device *pdev)
        return 0;
 
 err_sysfs_create:
-       if (bldev != NULL)
-               backlight_device_unregister(bldev);
+       backlight_device_unregister(bldev);
 err_bl:
        destroy_workqueue(ddata->workqueue);
 err_reg:
index 983c8cf2441c5fde79e1167089ccdd38964f4c38..31f5178c22c7577136da27e6903dc37391d4a8fa 100644 (file)
@@ -115,8 +115,8 @@ static void omap_framebuffer_destroy(struct drm_framebuffer *fb)
 
        for (i = 0; i < n; i++) {
                struct plane *plane = &omap_fb->planes[i];
-               if (plane->bo)
-                       drm_gem_object_unreference_unlocked(plane->bo);
+
+               drm_gem_object_unreference_unlocked(plane->bo);
        }
 
        kfree(omap_fb);