drm/vc4: Delete unnecessary checks before two function calls
authorMarkus Elfring <elfring@users.sourceforge.net>
Fri, 15 Jul 2016 19:15:37 +0000 (21:15 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 18 Jul 2016 07:11:28 +0000 (09:11 +0200)
The following functions test whether their argument is NULL
and then return immediately.
* drm_fbdev_cma_hotplug_event
* drm_fbdev_cma_restore_mode

Thus the tests around their calls are 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/fb33d930-6a5c-c501-6676-26bd486f1cb5@users.sourceforge.net
drivers/gpu/drm/vc4/vc4_drv.c
drivers/gpu/drm/vc4/vc4_kms.c

index 9e88231b8906b60e33e0eeb502cbd324f889b570..493bb580a4138ba6b572d9a285e3e88830e9576d 100644 (file)
@@ -47,8 +47,7 @@ static void vc4_lastclose(struct drm_device *dev)
 {
        struct vc4_dev *vc4 = to_vc4_dev(dev);
 
-       if (vc4->fbdev)
-               drm_fbdev_cma_restore_mode(vc4->fbdev);
+       drm_fbdev_cma_restore_mode(vc4->fbdev);
 }
 
 static const struct file_operations vc4_drm_fops = {
index 8f4d5ffc32bef716e99283b748fd52daf454a3f2..0fa3c8128875e6efb8c1000f10e02095887b2d99 100644 (file)
@@ -26,8 +26,7 @@ static void vc4_output_poll_changed(struct drm_device *dev)
 {
        struct vc4_dev *vc4 = to_vc4_dev(dev);
 
-       if (vc4->fbdev)
-               drm_fbdev_cma_hotplug_event(vc4->fbdev);
+       drm_fbdev_cma_hotplug_event(vc4->fbdev);
 }
 
 struct vc4_commit {