]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sort.h: hoist cmp_int() into generic header file
authorFedor Pchelkin <pchelkin@ispras.ru>
Sun, 27 Apr 2025 20:14:49 +0000 (23:14 +0300)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 12 May 2025 00:54:12 +0000 (17:54 -0700)
commitf3def8270c67217efb0e23dcd54714f74de3b6b2
treeb9f2bbccddc40c88fde219d515f22be7e3c39bcc
parent1785c67e2adc4d1899685b36dd10f7ebbf117178
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: Fedor Pchelkin <pchelkin@ispras.ru>
Suggested-by: Darrick J. Wong <djwong@kernel.org>
Acked-by: Kent Overstreet <kent.overstreet@linux.dev>
Acked-by: Coly 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: Andrew Morton <akpm@linux-foundation.org>
drivers/md/bcache/btree.c
fs/bcachefs/util.h
fs/pipe.c
fs/xfs/xfs_zone_gc.c
include/linux/sort.h