From patchwork Fri Jul 22 10:56:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9243387 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EF0D260757 for ; Fri, 22 Jul 2016 10:56:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE7A32624D for ; Fri, 22 Jul 2016 10:56:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2A5927F9A; Fri, 22 Jul 2016 10:56:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 783D72624D for ; Fri, 22 Jul 2016 10:56:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 48A146EB38; Fri, 22 Jul 2016 10:56:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.15.3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8BBB06EB36 for ; Fri, 22 Jul 2016 10:56:38 +0000 (UTC) Received: from [192.168.1.2] ([77.182.75.73]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0MKaHP-1bRvRO3SZr-00239N; Fri, 22 Jul 2016 12:56:26 +0200 Subject: [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob() To: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, CK Hu , Daniel Vetter , David Airlie , Matthias Brugger References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> From: SF Markus Elfring Message-ID: <515bcb7e-3e00-3438-cc47-227cfcd41990@users.sourceforge.net> Date: Fri, 22 Jul 2016 12:56:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <5317A59D.4@users.sourceforge.net> X-Provags-ID: V03:K0:HLog75xzQIYZrCnmM7FSo9zet5k76tXLAS8GL9udYU9yCe2bszQ xYjVwr3LmrI9z76WFYMN4AtJRnZc9xzUn3cO8vtq/J1Py5/x/XujkLSOajj0z9Tq/fSSdxp 9sSp0xfbtJoAUDlXCLCL1RJcvtODdO4pF7eFMO+QLHLR52xUDb0ozLRzvZVe6sZvNekxqqw iZwFHJTo9nOC4pz0rMKtg== X-UI-Out-Filterresults: notjunk:1; V01:K0:uK15JH18llw=:2EwfDaJ4dBkC2dHZr4v8No akeE4WIPngrfYelVQSBieRbVuc6YyMhGnWnzqklUWOmtJb09jFByeaPWuZ63wEu0z7R46rOZT 9MVPcTI1twbeO4N7BqZl87h6oCN4XI1zzBrYbSABtZfl4yiVCNQgUeCT08kmYI+fd0THto8Zr CxjD7VINc5Vs97E9AwVb3yUVhpICVDCirratCv6Ce5wuSOXEgE7u6olc2ZMxZWgYUrD2Eaa1k XmsEu8LukIZC++0BGgNNokFPUdd4TUJnjyEPzymYClEt9VewC8y+WbpVI0cxkNboPMnGoZhGg kgJXUxP2OAaah9o/thLfE6NN5laddG3Qoxi62AbJLJ3pDHurgRwWUnRKZ3ZJV1gDfuThqk4b8 oAmGhiBQUnrsyKuk9rY2UC7A4wRQxygyWGJ/0gM4NzlT9yxQ7DjSG1gDwsMmfxV6L/6P92pqV X7ayp9qKtP3jW/qPmiNH9GRiYDEMklS6C+SsJELg/VARW2OSYLXrfsQtSDTgXt31e4FjTUKN7 wl8GTlIJa1/uJk7jZosU2cqUdPA2qqUSOyd7kAaaw7CkdOoyiIoq8PZ7cSVvLRk3P5wVnla4P 7Epw5lAit2VUu+f3bZ2bZd21TQxYo2eDWyGfXtE4gWuKEha8qjAOvKuqh0fj+MGc6HeLP1ciI UB00BHq2VizJFXgeipBOqui75FQr7ZRUJ4dv8FpqEUtBZEU/Iiou/oG0sSsNPET18/avaLAY4 tJVpE2CbxwBJBZotqt7obdJU4oz3gV6iAY4Mle2ScBE5ZN6Ug/kPHrDQ9CoEPDZa9CXp8yq57 8GwBYnE Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring 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 Reviewed-by: Matthias Brugger --- 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 {