From patchwork Sun Nov 30 20:25:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 5409281 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 237129F1C5 for ; Sun, 30 Nov 2014 20:26:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3ACF9201DD for ; Sun, 30 Nov 2014 20:26:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 61D2B2017A for ; Sun, 30 Nov 2014 20:26:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752135AbaK3UZ6 (ORCPT ); Sun, 30 Nov 2014 15:25:58 -0500 Received: from mout.web.de ([212.227.17.11]:56324 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751650AbaK3UZ5 (ORCPT ); Sun, 30 Nov 2014 15:25:57 -0500 Received: from [192.168.1.2] ([78.49.11.120]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0M9XUJ-1XkPIW30sp-00D0iQ; Sun, 30 Nov 2014 21:25:51 +0100 Message-ID: <547B7D48.1010507@users.sourceforge.net> Date: Sun, 30 Nov 2014 21:25:44 +0100 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Antti Palosaari , Mauro Carvalho Chehab , linux-media@vger.kernel.org CC: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: [PATCH 1/2] [media] tuners: Deletion of unnecessary checks before the function call "release_firmware" 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> <547B7C36.1070600@users.sourceforge.net> In-Reply-To: <547B7C36.1070600@users.sourceforge.net> X-Provags-ID: V03:K0:+EvlZ6BDN/R23h33ezRWRSWbyIynqGUVHjt7NqhCPzxBrrs8K6H 1XuOyVxhHE6bPDAIq2IWxqKL8m9gWXnL0ySzB9UCR0Rt+Ac85waj29yFSKYwP1KH+S+3mzi K3J82xAvq+Dgkf/ixQf8YnxFAXN2xDXj9c44z8rbgu0vgEwNWGvmIOvwSW4RxDC6budXWW/ syx8ybWgQmEHf4Zo/Gw6g== X-UI-Out-Filterresults: notjunk:1; Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 30 Nov 2014 19:05:48 +0100 The release_firmware() 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/media/tuners/si2157.c | 3 +-- drivers/media/tuners/xc5000.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index 8e57696..e17ab1f 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -196,8 +196,7 @@ warm: return 0; err: - if (fw) - release_firmware(fw); + release_firmware(fw); dev_dbg(&s->client->dev, "failed=%d\n", ret); return ret; diff --git a/drivers/media/tuners/xc5000.c b/drivers/media/tuners/xc5000.c index 705c258..2a039de 100644 --- a/drivers/media/tuners/xc5000.c +++ b/drivers/media/tuners/xc5000.c @@ -1336,8 +1336,7 @@ static int xc5000_release(struct dvb_frontend *fe) if (priv) { cancel_delayed_work(&priv->timer_sleep); - if (priv->firmware) - release_firmware(priv->firmware); + release_firmware(priv->firmware); hybrid_tuner_release_state(priv); }