perf: arm-cmn: Fix unsigned comparison to less than zero
Subsystems (2)
Will Deacon
maintainerPATCH 1/2 perf: arm-cmn: Fix unsigned comparison to less than zero
Ensure that the 'irq' field of 'struct arm_cmn_dtc' is a signed int so that it can be compared '< 0'.
Addresses-Coverity-ID: 1497488 ("Unsigned compared against 0")
Fixes 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver")
Reported-by Gustavo A. R. Silva <[email protected]>
Signed-off-by Will Deacon <[email protected]>
--- drivers/perf/arm-cmn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/perf/arm-cmn.c +1 -1
@@ -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;
Signature · 7 lines
2.28.0.709.gb0816b6eb0-goog _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Will Deacon
maintainerPATCH 2/2 perf: arm-cmn: Fix conversion specifiers for node type
The node type field is an enum type, so print it as a 32-bit quantity rather than as an unsigned short.
Reported-by kernel test robot <[email protected]>
Signed-off-by Will Deacon <[email protected]>
--- drivers/perf/arm-cmn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/perf/arm-cmn.c +2 -2
@@ -1324,7 +1324,7 @@ static void arm_cmn_init_node_info(struct arm_cmn *cmn, u32 offset, struct arm_celse level =2 ; -dev_dbg (cmn->dev,"node%*c%#06hx%*ctype:%-#6hx id:%-4hd off:%#x\n" , +dev_dbg (cmn->dev,"node%*c%#06hx%*ctype:%-#6x id:%-4hd off:%#x\n" , (level *2 ) +1 ,' ' , node->id,5 - (level *2 ),' ' , node->type, node->logid, offset); }
@@ -1430,7 +1430,7 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)break ;/* Something has gone horribly wrong */ default : -dev_err (cmn->dev,"invalid device node type: 0x%hx\n" , dn->type); +dev_err (cmn->dev,"invalid device node type: 0x%x\n" , dn->type);return -ENODEV ; } }
Signature · 7 lines
2.28.0.709.gb0816b6eb0-goog _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 8 lines · Will Deacon
Ensure that the 'irq' field of 'struct
arm_cmn_dtc' is a signed int so that it can be compared '< 0'.Addresses-Coverity-ID: 1497488 ("Unsigned compared against 0")
Fixes 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver")Reported-by Gustavo A. R. Silva <[email protected]>Signed-off-by Will Deacon <[email protected]>
Reviewed-by Gustavo A. R. Silva <[email protected]>
Thanks
--
Gustavo
Quoted 20 lines
--- drivers/perf/arm-cmn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/perf/arm-cmn.c +1
-1@@ -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;Signature · 1 line
2.28.0.709.gb0816b6eb0-goog
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel