* Re: [PATCH 2/2] perf pmu: Improve CPU core PMU HW event list ordering
[not found] ` <CAM9d7ciyOmzxUZ4dGJ12607rTnCCdNBbuQtv1gEmUe0FQJxELA@mail.gmail.com>
@ 2020-06-15 14:51 ` John Garry
0 siblings, 0 replies; only message in thread
From: John Garry @ 2020-06-15 14:51 UTC (permalink / raw)
To: Namhyung Kim
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, will,
linux-arm-kernel, linuxarm, Ian Rogers, linux-kernel
On 15/06/2020 15:36, Namhyung Kim wrote:>> static int cmp_sevent(const
void *a, const void *b)
>> @@ -1416,6 +1417,12 @@ static int cmp_sevent(const void *a, const void *b)
>> if (n)
>> return n;
>> }
>> +
>> + if (as->is_cpu && !bs->is_cpu)
>> + return -1;
>> + else if (!as->is_cpu && bs->is_cpu)
>> + return 1;
>> +
> This can be:
>
> if (as->is_cpu != bs->is_cpu)
> return bs->is_cpu - as->is_cpu;
>
That's more concise, but maybe not as readable at a glance. I don't mind
though, so can change.
Thanks,
John
^ permalink raw reply [flat|nested] only message in thread