Skip to contentSkip to conversation

perf: Add Arm CMN-600 PMU driver

bug report Dan Carpenter 1 participant 1 message Sep 30, 2020

lore
Share & tools
lore
#0 lore raw

Hello Robin Murphy,

The patch 0ba64770a2f2: "perf: Add Arm CMN-600 PMU driver" from Sep 18, 2020, leads to the following static checker warning:

	drivers/perf/arm-cmn.c:1252 arm_cmn_init_dtc()
	warn: unsigned 'dtc->irq' is never less than zero.

drivers/perf/arm-cmn.c
1245 static int arm_cmn_init_dtc(struct arm_cmn *cmn, struct arm_cmn_node *dn, int idx) 1246 {
1247 struct arm_cmn_dtc *dtc = cmn->dtc + idx;
1248 struct arm_cmn_node *xp;
1249

  1250          dtc->base = dn->pmu_base - CMN_PMU_OFFSET;
  1251          dtc->irq = platform_get_irq(to_platform_device(cmn->dev), idx);
  1252          if (dtc->irq < 0)
                    ^^^^^^^^^^^^

"dtc->irq" is unsigned.

  1253                  return dtc->irq;
  1254  
  1255          writel_relaxed(0, dtc->base + CMN_DT_PMCR);
  1256          writel_relaxed(0x1ff, dtc->base + CMN_DT_PMOVSR_CLR);

regards,
dan carpenter

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel