perf: Remove dev_err() usage after platform_get_irq()
authorStephen Boyd <swboyd@chromium.org>
Tue, 30 Jul 2019 18:15:32 +0000 (11:15 -0700)
committerWill Deacon <will@kernel.org>
Wed, 31 Jul 2019 16:15:20 +0000 (17:15 +0100)
We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.

// <smpl>
@@
expression ret;
struct platform_device *E;
@@

ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);

if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>

While we're here, remove braces on if statements that only have one
statement (manually).

Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
drivers/perf/hisilicon/hisi_uncore_hha_pmu.c
drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c
drivers/perf/qcom_l2_pmu.c
drivers/perf/xgene_pmu.c

index 6ad0823bcf23781b68000637d3dd956756c3e4cf..e42d4464c2cf7216191f1082d35abc8f3a060294 100644 (file)
@@ -217,10 +217,8 @@ static int hisi_ddrc_pmu_init_irq(struct hisi_pmu *ddrc_pmu,
 
        /* Read and init IRQ */
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "DDRC PMU get irq fail; irq:%d\n", irq);
+       if (irq < 0)
                return irq;
-       }
 
        ret = devm_request_irq(&pdev->dev, irq, hisi_ddrc_pmu_isr,
                               IRQF_NOBALANCING | IRQF_NO_THREAD,
index 4f2917f3e25e7e2f1736afa05f832bda861fb8be..f28063873e1117e57bc7f4c1212a32125df430fd 100644 (file)
@@ -207,10 +207,8 @@ static int hisi_hha_pmu_init_irq(struct hisi_pmu *hha_pmu,
 
        /* Read and init IRQ */
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "HHA PMU get irq fail; irq:%d\n", irq);
+       if (irq < 0)
                return irq;
-       }
 
        ret = devm_request_irq(&pdev->dev, irq, hisi_hha_pmu_isr,
                              IRQF_NOBALANCING | IRQF_NO_THREAD,
index 9153e093f9df136bca9841a89b5503b88f937f76..078b8dc5725034d00f600cdc71fa956c2bb77460 100644 (file)
@@ -206,10 +206,8 @@ static int hisi_l3c_pmu_init_irq(struct hisi_pmu *l3c_pmu,
 
        /* Read and init IRQ */
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "L3C PMU get irq fail; irq:%d\n", irq);
+       if (irq < 0)
                return irq;
-       }
 
        ret = devm_request_irq(&pdev->dev, irq, hisi_l3c_pmu_isr,
                               IRQF_NOBALANCING | IRQF_NO_THREAD,
index d06182fe14b85cee047ba36d52840094f59d52dc..21d6991dbe0ba8efa054499c9695a916752336b1 100644 (file)
@@ -909,12 +909,8 @@ static int l2_cache_pmu_probe_cluster(struct device *dev, void *data)
        cluster->cluster_id = fw_cluster_id;
 
        irq = platform_get_irq(sdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev,
-                       "Failed to get valid irq for cluster %ld\n",
-                       fw_cluster_id);
+       if (irq < 0)
                return irq;
-       }
        irq_set_status_flags(irq, IRQ_NOAUTOEN);
        cluster->irq = irq;
 
index 3259e2ebeb392a0aef655f8243cae57d5225b396..7e328d6385c37be0344c8e9d4ca9e3d914458bec 100644 (file)
@@ -1901,10 +1901,8 @@ static int xgene_pmu_probe(struct platform_device *pdev)
        }
 
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "No IRQ resource\n");
+       if (irq < 0)
                return -EINVAL;
-       }
 
        rc = devm_request_irq(&pdev->dev, irq, xgene_pmu_isr,
                                IRQF_NOBALANCING | IRQF_NO_THREAD,