Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1676480
| From | kbuild test robot <lkp@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] drivers: perf: hisi: fix ptr_ret.cocci warnings |
| Date | 2017-06-28 11:30 +0200 |
| Message-ID | <tXhsm-50j-25@gated-at.bofh.it> (permalink) |
| References | <tXhsl-50j-9@gated-at.bofh.it> <tWTzK-5PY-39@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c:348: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: 05958712d8d4 ("drivers: perf: hisi: Add support for HiSilicon SoC L3C PMU driver")
CC: Shaokun Zhang <zhangshaokun@hisilicon.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
hisi_uncore_l3c_pmu.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c
+++ b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c
@@ -345,10 +345,7 @@ static int hisi_l3c_pmu_init_data(struct
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
l3c_pmu->base = devm_ioremap_resource(dev, res);
- if (IS_ERR(l3c_pmu->base))
- return PTR_ERR(l3c_pmu->base);
-
- return 0;
+ return PTR_ERR_OR_ZERO(l3c_pmu->base);
}
static struct attribute *hisi_l3c_pmu_format_attr[] = {
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/6] Add HiSilicon SoC uncore Performance Monitoring Unit driver Shaokun Zhang <zhangshaokun@hisilicon.com> - 2017-06-27 10:00 +0200
[PATCH 3/6] drivers: perf: hisi: Add support for HiSilicon SoC L3C PMU driver Shaokun Zhang <zhangshaokun@hisilicon.com> - 2017-06-27 10:00 +0200
[PATCH] drivers: perf: hisi: fix ptr_ret.cocci warnings kbuild test robot <lkp@intel.com> - 2017-06-28 11:30 +0200
[PATCH 1/6] Documentation: perf: hisi: Documentation for HiSilicon SoC PMU driver Shaokun Zhang <zhangshaokun@hisilicon.com> - 2017-06-27 10:00 +0200
csiph-web