Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1676547

[PATCH] drivers: perf: hisi: fix ptr_ret.cocci warnings

From kbuild test robot <lkp@intel.com>
Newsgroups linux.kernel
Subject [PATCH] drivers: perf: hisi: fix ptr_ret.cocci warnings
Date 2017-06-28 12:50 +0200
Message-ID <tXiHM-5FO-7@gated-at.bofh.it> (permalink)
References <tXiHL-5FO-1@gated-at.bofh.it> <tWTzJ-5PY-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <zhangshaokun@hisilicon.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 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[] = {

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 5/6] drivers: perf: hisi: Add support for HiSilicon SoC DDRC PMU driver Shaokun Zhang <zhangshaokun@hisilicon.com> - 2017-06-27 10:00 +0200
  Re: [PATCH 5/6] drivers: perf: hisi: Add support for HiSilicon SoC  DDRC PMU driver kbuild test robot <lkp@intel.com> - 2017-06-28 12:50 +0200
  [PATCH] drivers: perf: hisi: fix ptr_ret.cocci warnings kbuild test robot <lkp@intel.com> - 2017-06-28 12:50 +0200

csiph-web