From patchwork Fri Jan 8 02:04:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 7981831 Return-Path: X-Original-To: patchwork-tpmdd-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B06359F32E for ; Fri, 8 Jan 2016 02:06:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F2EE72013D for ; Fri, 8 Jan 2016 02:06:03 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 178032012E for ; Fri, 8 Jan 2016 02:06:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1aHMRE-0000Ke-Qc; Fri, 08 Jan 2016 02:06:00 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1aHMRD-0000KY-A8 for tpmdd-devel@lists.sourceforge.net; Fri, 08 Jan 2016 02:05:59 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of intel.com designates 134.134.136.24 as permitted sender) client-ip=134.134.136.24; envelope-from=fengguang.wu@intel.com; helo=mga09.intel.com; Received: from mga09.intel.com ([134.134.136.24]) by sog-mx-1.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1aHMRB-0004Dq-7w for tpmdd-devel@lists.sourceforge.net; Fri, 08 Jan 2016 02:05:59 +0000 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP; 07 Jan 2016 18:05:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,536,1444719600"; d="scan'208";a="25640913" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga004.fm.intel.com with ESMTP; 07 Jan 2016 18:05:50 -0800 Received: from kbuild by bee with local (Exim 4.83) (envelope-from ) id 1aHMQz-000Y3P-Qj; Fri, 08 Jan 2016 10:05:45 +0800 Date: Fri, 8 Jan 2016 10:04:41 +0800 From: kbuild test robot To: Jason Gunthorpe Message-ID: <20160108020441.GA12462@lkp-nex06> References: <201601081058.vDvDPN9c%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1452213386-21460-8-git-send-email-jgunthorpe@obsidianresearch.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false X-Spam-Score: -0.7 (/) X-Headers-End: 1aHMRB-0004Dq-7w Cc: tpmdd-devel@lists.sourceforge.net, kbuild-all@01.org, linux-kernel@vger.kernel.org Subject: [tpmdd-devel] [PATCH] tpm_crb: fix ptr_ret.cocci warnings X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Tpm Device Driver maintainance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces@lists.sourceforge.net X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, HK_RANDOM_ENVFROM, RCVD_IN_DNSWL_HI, 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 drivers/char/tpm/tpm_crb.c:297:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci CC: Jason Gunthorpe Signed-off-by: Fengguang Wu --- tpm_crb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) ------------------------------------------------------------------------------ --- a/drivers/char/tpm/tpm_crb.c +++ b/drivers/char/tpm/tpm_crb.c @@ -294,9 +294,7 @@ static int crb_map_io(struct acpi_device memcpy_fromio(&pa, &priv->cca->rsp_pa, 8); pa = le64_to_cpu(pa); priv->rsp = crb_access(dev, priv, pa, ioread32(&priv->cca->rsp_size)); - if (IS_ERR(priv->rsp)) - return PTR_ERR(priv->rsp); - return 0; + return PTR_ERR_OR_ZERO(priv->rsp); } static int crb_acpi_add(struct acpi_device *device)