aboutsummaryrefslogtreecommitdiff
path: root/lib/test_min_heap.c
AgeCommit message (Collapse)AuthorFilesLines
2022-10-11treewide: use get_random_u32() when possibleJason A. Donenfeld1-3/+3
The prandom_u32() function has been a deprecated inline wrapper around get_random_u32() for several releases now, and compiles down to the exact same code. Replace the deprecated wrapper with a direct call to the real function. The same also applies to get_random_int(), which is just a wrapper around get_random_u32(). This was done as a basic find and replace. Reviewed-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Kees Cook <[email protected]> Reviewed-by: Yury Norov <[email protected]> Reviewed-by: Jan Kara <[email protected]> # for ext4 Acked-by: Toke Høiland-Jørgensen <[email protected]> # for sch_cake Acked-by: Chuck Lever <[email protected]> # for nfsd Acked-by: Jakub Kicinski <[email protected]> Acked-by: Mika Westerberg <[email protected]> # for thunderbolt Acked-by: Darrick J. Wong <[email protected]> # for xfs Acked-by: Helge Deller <[email protected]> # for parisc Acked-by: Heiko Carstens <[email protected]> # for s390 Signed-off-by: Jason A. Donenfeld <[email protected]>
2020-03-06lib: Introduce generic min-heapIan Rogers1-0/+194
Supports push, pop and converting an array into a heap. If the sense of the compare function is inverted then it can provide a max-heap. Based-on-work-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Ian Rogers <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lkml.kernel.org/r/[email protected]