Messages in this thread | | | Subject | Re: [PATCH 2/2] perf pmu: Improve CPU core PMU HW event list ordering | From | John Garry <> | Date | Mon, 15 Jun 2020 15:51:19 +0100 |
| |
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
| |