[PATCH 2/3] perf/arm-cmn: Rework DTC counters (again)

Mark Rutland mark.rutland at arm.com
Mon Oct 23 02:06:17 PDT 2023


On Fri, Oct 20, 2023 at 03:50:30PM -0700, Ilkka Koskinen wrote:
> Hi Robin,
> 
> I have one comment, otherwise the patch looks good to me.

> > +/* @i is the DTC number, @idx is the counter index on that DTC */
> > +#define for_each_hw_dtc_idx(hw, i, idx) \
> > +	for (int i = 0, idx; i < CMN_MAX_DTCS; i++) if ((idx = hw->dtc_idx[i]) >= 0)
> 
> Isn't that "idx" unnecessary in the initialization?

That creates the 'idx' variable that's assigned to by `idx = hw->dtc_idx[i]`,
so that is necessary.

Mark.



More information about the linux-arm-kernel mailing list