From patchwork Sun Jul 17 21:00:15 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: 9233837 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 358E16075D for ; Sun, 17 Jul 2016 21:00:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26C2B269E2 for ; Sun, 17 Jul 2016 21:00:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B11A26A4D; Sun, 17 Jul 2016 21:00:54 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDDA4206AF for ; Sun, 17 Jul 2016 21:00:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751251AbcGQVAg (ORCPT ); Sun, 17 Jul 2016 17:00:36 -0400 Received: from mout.web.de ([212.227.17.12]:52877 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751174AbcGQVAe (ORCPT ); Sun, 17 Jul 2016 17:00:34 -0400 Received: from [192.168.1.2] ([77.182.139.144]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0LgpVS-1b3Fzu09ZO-00oCuX; Sun, 17 Jul 2016 23:00:20 +0200 Subject: [PATCH] [media] cec: Delete an unnecessary check before the function call "rc_free_device" To: linux-media@vger.kernel.org, devel@driverdev.osuosl.org, Mauro Carvalho Chehab , Hans Verkuil , Greg Kroah-Hartman 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> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: Date: Sun, 17 Jul 2016 23:00:15 +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:Vs6asmybJwDVSrTQizMB0KgcsTnJ5f24AbIwlMmmTnS6g0jqlo9 bF7FBWQ06KHVOdNnTjJj0wBFolCpjzpIiLfz6gS+Z9jtvt5FbgQJWMgQ2TQyJOUcsp8nYPY g6D6qaBws33Kqm999tE1os0FoI5Hj51k4r+nSdCTkeAUB6EjvvDHW/wO3K2uAmrPCsEq307 ufu0b7WtLZmP11NwQ3i9w== X-UI-Out-Filterresults: notjunk:1; V01:K0:qD5yFOSQRv0=:1KmSK+AANE2HtRIn+9ruuv NpIBVslxdp540mbX29G1FYG2JgxW01x5N8qRDyYuA+gfWKkJJR7LBNmnjx7WAY7pnx6iqgVNc QFXEA669QDWRm1zPCeGPTkeWu9AoHWHJSGzlBAwmv00NZ1MI3rHrEfrWrIPLbQqg5Bf943bTL jFyiY2ePliU0KqsGineW0IC488aqyXsIa26vqDwS+mwEvVrFbl2zEM3FxeH0UUZ6mlAZlOycU G+dSQyXp/5KORqFNDl09Z0U+cE2879ysJAg8WwnovBN9XII3HuLaem/ey4sq26yHrh9YeDzMF qH17QPni+C3Z4mGq+8biLqEsIX46lNaMXVaQt3LNaodeDMQZHcUPcABJ+JLMcumRjsobMqIUT 4fBAUEH5dKdslnQeDmIdncLPnqiUM10c62MhOG7KOK1eOtF5ojl7yWC93Pxl+uNfuTbBv/0sC GikUDels74ubyvSWz7MXEQeMextiB0kwRknsyN8bg03Ph3s+MxxXYbf4b1dXtHQFiPZEB0qGh F3RDs+4gtDTvBtcSzsIbLnUso8Xw/GjLyJfd288+kBRpw0PQcVm0zDRkrutkseTUXLerij6Ek vjgG59Tg7GMAWeGkxq4cpX/dfimRiNeiH1Oz8DC1FedFiTf/8/gxHBfSdWXVFlai21iIdVleD OBxvDp935zNA+0tQanTxFcnO8/NebLRQu/b9lWs6ketDsBIYntWsif0nZrhPkSefsSCI2jz/B O/Q8PJBMyu5GrDyY3KcsS7SVIgkTGuNaRi2MDFqk9Lj446ov5FF78540Jb2RVwdJFfMyd7sAD TtXzluw Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 17 Jul 2016 22:52:49 +0200 The rc_free_device() 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 --- drivers/staging/media/cec/cec-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/media/cec/cec-core.c b/drivers/staging/media/cec/cec-core.c index 61a1e69..123e1bf 100644 --- a/drivers/staging/media/cec/cec-core.c +++ b/drivers/staging/media/cec/cec-core.c @@ -354,8 +354,7 @@ void cec_delete_adapter(struct cec_adapter *adap) if (adap->kthread_config) kthread_stop(adap->kthread_config); #if IS_ENABLED(CONFIG_RC_CORE) - if (adap->rc) - rc_free_device(adap->rc); + rc_free_device(adap->rc); #endif kfree(adap); }