]> git.baikalelectronics.ru Git - kernel.git/commitdiff
perf/arm_pmu_platform: fix tests for platform_get_irq() failure
authorYu Zhe <yuzhe@nfschina.com>
Thu, 25 Aug 2022 01:18:44 +0000 (09:18 +0800)
committerWill Deacon <will@kernel.org>
Thu, 1 Sep 2022 11:01:40 +0000 (12:01 +0100)
The platform_get_irq() returns negative error codes.  It can't actually
return zero.

Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
Link: https://lore.kernel.org/r/20220825011844.8536-1-yuzhe@nfschina.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/arm_pmu_platform.c

index 513de1f54e2d7371ceca11b9427a265394aeadc9..933b96e243b84b1354b9d2f4eae6cbea0838cb04 100644 (file)
@@ -117,7 +117,7 @@ static int pmu_parse_irqs(struct arm_pmu *pmu)
 
        if (num_irqs == 1) {
                int irq = platform_get_irq(pdev, 0);
-               if (irq && irq_is_percpu_devid(irq))
+               if ((irq > 0) && irq_is_percpu_devid(irq))
                        return pmu_parse_percpu_irq(pmu, irq);
        }