lkml.org 
[lkml]   [2016]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob()
    From
    Date
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Fri, 22 Jul 2016 12:48:12 +0200

    The drm_property_unreference_blob() 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>
    ---
    drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 4 +---
    1 file changed, 1 insertion(+), 3 deletions(-)

    diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
    index 24aa3ba..07541d0 100644
    --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
    +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
    @@ -112,9 +112,7 @@ static void mtk_drm_crtc_reset(struct drm_crtc *crtc)
    struct mtk_crtc_state *state;

    if (crtc->state) {
    - if (crtc->state->mode_blob)
    - drm_property_unreference_blob(crtc->state->mode_blob);
    -
    + drm_property_unreference_blob(crtc->state->mode_blob);
    state = to_mtk_crtc_state(crtc->state);
    memset(state, 0, sizeof(*state));
    } else {
    --
    2.9.2
    \
     
     \ /
      Last update: 2016-07-22 13:41    [W:5.273 / U:0.140 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site