linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lkp@intel.com (kbuild test robot)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] drivers: perf: hisi: fix ptr_ret.cocci warnings
Date: Wed, 28 Jun 2017 17:21:18 +0800	[thread overview]
Message-ID: <20170628092118.GA3354@lkp-wsm-ep1> (raw)
In-Reply-To: <1498552001-182148-4-git-send-email-zhangshaokun@hisilicon.com>

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

  parent reply	other threads:[~2017-06-28  9:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-27  8:26 [PATCH 0/6] Add HiSilicon SoC uncore Performance Monitoring Unit driver Shaokun Zhang
2017-06-27  8:26 ` [PATCH 1/6] Documentation: perf: hisi: Documentation for HiSilicon SoC PMU driver Shaokun Zhang
2017-06-27  8:26 ` [PATCH 2/6] drivers: perf: hisi: Add support for HiSilicon SoC uncore " Shaokun Zhang
2017-06-28  1:49   ` kbuild test robot
2017-06-28  5:50     ` Zhangshaokun
2017-06-27  8:26 ` [PATCH 3/6] drivers: perf: hisi: Add support for HiSilicon SoC L3C " Shaokun Zhang
2017-06-28  9:21   ` kbuild test robot
2017-06-28  9:21   ` kbuild test robot [this message]
2017-06-27  8:26 ` [PATCH 4/6] drivers: perf: hisi: Add support for HiSilicon SoC HHA " Shaokun Zhang
2017-06-28  9:56   ` kbuild test robot
2017-06-28 10:55     ` John Garry
2017-06-28  9:56   ` [PATCH] drivers: perf: hisi: fix ptr_ret.cocci warnings kbuild test robot
2017-06-27  8:26 ` [PATCH 5/6] drivers: perf: hisi: Add support for HiSilicon SoC DDRC PMU driver Shaokun Zhang
2017-06-28 10:42   ` [PATCH] drivers: perf: hisi: fix ptr_ret.cocci warnings kbuild test robot
2017-06-28 10:42   ` [PATCH 5/6] drivers: perf: hisi: Add support for HiSilicon SoC DDRC PMU driver kbuild test robot
2017-06-27  8:26 ` [PATCH 6/6] arm64: MAINTAINERS: hisi: Add HiSilicon SoC PMU support Shaokun Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170628092118.GA3354@lkp-wsm-ep1 \
    --to=lkp@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).