perf: arm-cmn: Fix unsigned comparison to less than zero
authorWill Deacon <will@kernel.org>
Thu, 1 Oct 2020 10:54:54 +0000 (11:54 +0100)
committerWill Deacon <will@kernel.org>
Thu, 1 Oct 2020 21:29:53 +0000 (22:29 +0100)
Ensure that the 'irq' field of 'struct arm_cmn_dtc' is a signed int
so that it can be compared '< 0'.

Link: https://lore.kernel.org/r/20200929170835.GA15956@embeddedor
Addresses-Coverity-ID: 1497488 ("Unsigned compared against 0")
Fixes: 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver")
Reported-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/arm-cmn.c

index e824b5b..cd4da4c 100644 (file)
@@ -217,7 +217,7 @@ struct arm_cmn_node {
 
 struct arm_cmn_dtc {
        void __iomem *base;
-       unsigned int irq;
+       int irq;
        int irq_friend;
        bool cc_active;