From patchwork Tue Jun 13 19:55:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 9784645 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 9882160244 for ; Tue, 13 Jun 2017 20:45:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 891E2201A4 for ; Tue, 13 Jun 2017 20:45:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C18820223; Tue, 13 Jun 2017 20:45:23 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D10CF201A4 for ; Tue, 13 Jun 2017 20:45:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1dKsgj-0001MR-Ck; Tue, 13 Jun 2017 20:45:21 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1dKsgh-0001MB-S9 for tpmdd-devel@lists.sourceforge.net; Tue, 13 Jun 2017 20:45:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:Message-ID:Subject:Cc:To:From:Date; bh=7AkP5/s4LT9eNuHWE4vbZveRbxv9RyaTv8DmeZh4Irc=; b=INPRBRlcSA49l88JBz9s9WKP3f7QSVTWL/p14UNYUlH/X00cRJulZ0J0iDaCYkoMTksUJohUAZFOkg56YoBDFi3iM+8o87DbdUG7Th4RzALGlon3gM/QZSdSJvzY2lluYVzJlxD4p+ORGF12dIql0ggK6jQpuf/N7ua4eGSZYo4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:Message-ID:Subject:Cc:To:From:Date; bh=7AkP5/s4LT9eNuHWE4vbZveRbxv9RyaTv8DmeZh4Irc=; b=YhwmR0oe/MULAW3R7c9pt+Zn4fNqp3ql4ioFV37iG+HZSIqoixz06WmgfM4NoJ4F3QlnPHYHSaJuVoN5H1QCKz/1+kATD9W4NFTjZU+uKrBXe92ebsbVRRZvgnIMmuuGgAM5wkix+WLLFdyF0zVsgoh5O9C/uf3TX2oVvN+NkIw=; Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of embeddedor.com designates 192.185.143.36 as permitted sender) client-ip=192.185.143.36; envelope-from=garsilva@embeddedor.com; helo=gateway31.websitewelcome.com; Received: from gateway31.websitewelcome.com ([192.185.143.36]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1dKsgf-0003TI-Qb for tpmdd-devel@lists.sourceforge.net; Tue, 13 Jun 2017 20:45:19 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 83B7646CB7 for ; Tue, 13 Jun 2017 14:55:43 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id KrxidFk8zrCyUKrxidfMYo; Tue, 13 Jun 2017 14:58:50 -0500 Received: from [189.152.192.143] (port=38404 helo=embeddedgus) by gator4166.hostgator.com with esmtpa (Exim 4.87) (envelope-from ) id 1dKruh-0025Dn-72; Tue, 13 Jun 2017 14:55:43 -0500 Date: Tue, 13 Jun 2017 14:55:42 -0500 From: "Gustavo A. R. Silva" To: Jarkko Sakkinen , Peter Huewe , Marcel Selhorst , Jason Gunthorpe Message-ID: <20170613195542.GA5677@embeddedgus> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170613180319.ezszgevmgwno2v5u@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - lists.sourceforge.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.152.192.143 X-Exim-ID: 1dKruh-0025Dn-72 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.152.192.143]:38404 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 5 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Headers-End: 1dKsgf-0003TI-Qb Subject: [tpmdd-devel] [PATCH] char: tpm: remove unnecessary NULL check X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: Tpm Device Driver maintainance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tpmdd-devel@lists.sourceforge.net, "Gustavo A. R. Silva" , linux-kernel@vger.kernel.org Errors-To: tpmdd-devel-bounces@lists.sourceforge.net X-Virus-Scanned: ClamAV using ClamSMTP Remove unnecessary NULL check. Pointer _chip_ cannot be NULL in this instance. Addresses-Coverity-ID: 1397646 Cc: Jarkko Sakkinen Signed-off-by: Gustavo A. R. Silva Reviewed-by: Jarkko Sakkinen Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen --- drivers/char/tpm/tpm_atmel.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c index 0d322ab..66a1452 100644 --- a/drivers/char/tpm/tpm_atmel.c +++ b/drivers/char/tpm/tpm_atmel.c @@ -144,13 +144,11 @@ static void atml_plat_remove(void) struct tpm_chip *chip = dev_get_drvdata(&pdev->dev); struct tpm_atmel_priv *priv = dev_get_drvdata(&chip->dev); - if (chip) { - tpm_chip_unregister(chip); - if (priv->have_region) - atmel_release_region(priv->base, priv->region_size); - atmel_put_base_addr(priv->iobase); - platform_device_unregister(pdev); - } + tpm_chip_unregister(chip); + if (priv->have_region) + atmel_release_region(priv->base, priv->region_size); + atmel_put_base_addr(priv->iobase); + platform_device_unregister(pdev); } static SIMPLE_DEV_PM_OPS(tpm_atml_pm, tpm_pm_suspend, tpm_pm_resume);