Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751637AbdF1KnT (ORCPT ); Wed, 28 Jun 2017 06:43:19 -0400 Received: from mga09.intel.com ([134.134.136.24]:8082 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751234AbdF1KnG (ORCPT ); Wed, 28 Jun 2017 06:43:06 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,275,1496127600"; d="scan'208";a="102261705" Date: Wed, 28 Jun 2017 18:42:18 +0800 From: kbuild test robot To: Shaokun Zhang Cc: kbuild-all@01.org, mark.rutland@arm.com, will.deacon@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linuxarm@huawei.com, Shaokun Zhang , Anurup M 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-Type: text/plain; charset=us-ascii 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 948 Lines: 29 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[] = {