GPU-DRM-Radeon: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 12 Jul 2016 20:00:55 +0000 (22:00 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 29 Jul 2016 18:36:51 +0000 (14:36 -0400)
The drm_gem_object_unreference_unlocked() function tests whether
its argument is NULL and then returns immediately.
Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_display.c

index 5f1cd695c9656e5d558fa4ed2c90203c39e7bfc0..1efab5fbf33225d5383acd500c7214fc7bd1f917 100644 (file)
@@ -1324,9 +1324,7 @@ static void radeon_user_framebuffer_destroy(struct drm_framebuffer *fb)
 {
        struct radeon_framebuffer *radeon_fb = to_radeon_framebuffer(fb);
 
-       if (radeon_fb->obj) {
-               drm_gem_object_unreference_unlocked(radeon_fb->obj);
-       }
+       drm_gem_object_unreference_unlocked(radeon_fb->obj);
        drm_framebuffer_cleanup(fb);
        kfree(radeon_fb);
 }