Skip to content

Commit 083ad28

Browse files
visitorckwakpm00
authored andcommitted
perf/core: update min_heap_callbacks to use default builtin swap
After introducing the default builtin swap implementation, update the min_heap_callbacks to replace the swp function pointer with NULL. This change allows the min heap to directly utilize the builtin swap, simplifying the code. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Kuan-Wei Chiu <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Ching-Chun (Jim) Huang <[email protected]> Cc: Coly Li <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Kent Overstreet <[email protected]> Cc: "Liang, Kan" <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Matthew Sakai <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent d559bb2 commit 083ad28

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

kernel/events/core.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3778,18 +3778,11 @@ static bool perf_less_group_idx(const void *l, const void *r, void __always_unus
37783778
return le->group_index < re->group_index;
37793779
}
37803780

3781-
static void swap_ptr(void *l, void *r, void __always_unused *args)
3782-
{
3783-
void **lp = l, **rp = r;
3784-
3785-
swap(*lp, *rp);
3786-
}
3787-
37883781
DEFINE_MIN_HEAP(struct perf_event *, perf_event_min_heap);
37893782

37903783
static const struct min_heap_callbacks perf_min_heap = {
37913784
.less = perf_less_group_idx,
3792-
.swp = swap_ptr,
3785+
.swp = NULL,
37933786
};
37943787

37953788
static void __heap_add(struct perf_event_min_heap *heap, struct perf_event *event)

0 commit comments

Comments
 (0)