Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751527AbdF1J5G (ORCPT ); Wed, 28 Jun 2017 05:57:06 -0400 Received: from mga05.intel.com ([192.55.52.43]:49704 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750829AbdF1J5A (ORCPT ); Wed, 28 Jun 2017 05:57:00 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,274,1496127600"; d="scan'208";a="119738541" Date: Wed, 28 Jun 2017 17:56:37 +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: <20170628095637.GA1038@lkp-wsm-ep1> References: <201706281706.O4jmBQ6k%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1498552001-182148-5-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: 938 Lines: 29 drivers/perf/hisilicon/hisi_uncore_hha_pmu.c:272: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: 2b8a651927f4 ("drivers: perf: hisi: Add support for HiSilicon SoC HHA PMU driver") CC: Shaokun Zhang Signed-off-by: Fengguang Wu --- hisi_uncore_hha_pmu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c @@ -269,10 +269,7 @@ static int hisi_hha_pmu_init_data(struct res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hha_pmu->base = devm_ioremap_resource(dev, res); - if (IS_ERR(hha_pmu->base)) - return PTR_ERR(hha_pmu->base); - - return 0; + return PTR_ERR_OR_ZERO(hha_pmu->base); } static struct attribute *hisi_hha_pmu_format_attr[] = {