From patchwork Wed Jun 28 10:42:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot X-Patchwork-Id: 9813933 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 ACC1A603D7 for ; Wed, 28 Jun 2017 10:43:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FDC71FF52 for ; Wed, 28 Jun 2017 10:43:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93A0B200F5; Wed, 28 Jun 2017 10:43:34 +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=-1.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2C5391FF52 for ; Wed, 28 Jun 2017 10:43:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SoPetxPMZ879XJEsAOHJK+lrjC+Zl+YKV4KQnxInTPQ=; b=WJQwi8Bmw/C96e L5j/QKZOgduUlxwkWbmgLu/atm5DayLGQfD8weglz3gxZdhRFYF5Aj8wxrjZg6bjvwDPM2qJf4BsZ a0jOh1cHxwvBJRX6Rx3W5NGj3p1JLo6upPngx1/qqeVXnBVIb0fjNbVL5u0/zLoC/BOPySMNX1gD/ NwTJJ7ipgLLoWnk9JZjx4ocMeFn9HqZv6sCz9v4kPj3xm0rTjle2PE5o8dWnz2m/C+29/iqKx8jr8 c01fiRSrPZg/pl/3oekJAb3zhN0kMb3En+Mx2b0ng6+R+nUZEJjy6rvKS+OIvbZB6e4+zwlwtKKpV L2xqFKqI0NYwllY4Lrig==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dQARX-0004Qz-9Q; Wed, 28 Jun 2017 10:43:31 +0000 Received: from mga14.intel.com ([192.55.52.115]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dQARU-0004OT-0g for linux-arm-kernel@lists.infradead.org; Wed, 28 Jun 2017 10:43:29 +0000 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2017 03:43:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,275,1496127600"; d="scan'208";a="102261705" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga004.jf.intel.com with ESMTP; 28 Jun 2017 03:43:03 -0700 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1dQAUY-000WAq-F7; Wed, 28 Jun 2017 18:46:38 +0800 Date: Wed, 28 Jun 2017 18:42:18 +0800 From: kbuild test robot To: Shaokun Zhang Subject: [PATCH] drivers: perf: hisi: fix ptr_ret.cocci warnings Message-ID: <20170628104218.GA32735@lkp-wsm-ep1> References: <201706281831.GsZKCdMT%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1498552001-182148-6-git-send-email-zhangshaokun@hisilicon.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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170628_034328_112031_91A2809C X-CRM114-Status: GOOD ( 10.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, linux-doc@vger.kernel.org, will.deacon@arm.com, linux-kernel@vger.kernel.org, linuxarm@huawei.com, Shaokun Zhang , kbuild-all@01.org, linux-arm-kernel@lists.infradead.org, Anurup M Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c:274: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 Fixes: 2dd3bcc1c8a7 ("drivers: perf: hisi: Add support for HiSilicon SoC DDRC PMU driver") CC: Shaokun Zhang Signed-off-by: Fengguang Wu --- hisi_uncore_ddrc_pmu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c @@ -271,10 +271,7 @@ static int hisi_ddrc_pmu_init_data(struc res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ddrc_pmu->base = devm_ioremap_resource(dev, res); - if (IS_ERR(ddrc_pmu->base)) - return PTR_ERR(ddrc_pmu->base); - - return 0; + return PTR_ERR_OR_ZERO(ddrc_pmu->base); } static struct attribute *hisi_ddrc_pmu_format_attr[] = {