Re: [PATCH v1 09/48] perf tests: Silence -Wshorten-64-to-32 warnings

Leo Yan
2025-04-28T11:10:09Z

Hi Namhyung, Ian,

On Thu, Apr 03, 2025 at 08:20:02AM -0700, Ian Rogers wrote:

[...]

> > > Anyway, I don't have time to do such a larger refactor so
> > > somebody else is going to need to pick that up. I did refactor the
> > > cases where I thought it mattered more, but as you say that does lead
> > > to a feeling of inconsistency in the series.
> >
> > I'm curious there are any actual errorenous cases other than the return
> > type of comparisons from Leo.

I am just wandering if we could give priority for errorenous cases.

Could you send fixes for these cases firstly and leave out refactoring
for later merging?

[...]

> There are lots of cases like:
> ```
> case ARM_SPE_COUNTER:
> if (idx == SPE_CNT_PKT_HDR_INDEX_TOTAL_LAT)
> - decoder->record.latency = payload;
> + decoder->record.latency = (u32)payload;

This would be fine. Since Arm SPE implements a counter with a maximum
of 16 bits, there will never be an overflow when storing the data in a
32-bit unsigned integer.

Thanks,
Leo