From mboxrd@z Thu Jan 1 00:00:00 1970 From: kbuild test robot Subject: [PATCH] tpm_crb: fix ptr_ret.cocci warnings Date: Fri, 8 Jan 2016 10:04:41 +0800 Message-ID: <20160108020441.GA12462@lkp-nex06> References: <201601081058.vDvDPN9c%fengguang.wu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1452213386-21460-8-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Jason Gunthorpe Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, kbuild-all-JC7UmRfGjtg@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: tpmdd-devel@lists.sourceforge.net 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) ------------------------------------------------------------------------------