diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2016-07-22 08:28:31 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-07-22 10:27:59 +0200 |
commit | 76e4c327ea51d0da47938e343ef27b988bc5c659 (patch) | |
tree | 34949cef01cf2edc7f158ea3e34f94caab60aad2 /drivers | |
parent | e8d3ef02787fc72996cfb423180dc79764c239fa (diff) | |
download | linux-76e4c327ea51d0da47938e343ef27b988bc5c659.tar.gz linux-76e4c327ea51d0da47938e343ef27b988bc5c659.tar.bz2 linux-76e4c327ea51d0da47938e343ef27b988bc5c659.zip |
GPU-DRM-OMAP: Delete unnecessary checks before two function calls
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
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_fb.c | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c index 1b0cf2d8224b..0eae8afaed90 100644 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c @@ -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: diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c index 983c8cf2441c..31f5178c22c7 100644 --- a/drivers/gpu/drm/omapdrm/omap_fb.c +++ b/drivers/gpu/drm/omapdrm/omap_fb.c @@ -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); |