Commit f3def827 authored by Fedor Pchelkin's avatar Fedor Pchelkin Committed by Andrew Morton
Browse files

sort.h: hoist cmp_int() into generic header file

Deduplicate the same functionality implemented in several places by
moving the cmp_int() helper macro into linux/sort.h.

The macro performs a three-way comparison of the arguments mostly useful
in different sorting strategies and algorithms.

Link: https://lkml.kernel.org/r/20250427201451.900730-1-pchelkin@ispras.ru


Signed-off-by: default avatarFedor Pchelkin <pchelkin@ispras.ru>
Suggested-by: default avatarDarrick J. Wong <djwong@kernel.org>
Acked-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
Acked-by: default avatarColy Li <colyli@kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Carlos Maiolino <cem@kernel.org>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Coly Li <colyli@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 1785c67e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment