lkml.org 
[lkml]   [2017]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] drivers: perf: hisi: fix ptr_ret.cocci warnings
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 <zhangshaokun@hisilicon.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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[] = {
\
 
 \ /
  Last update: 2017-06-28 11:57    [W:0.094 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site