summaryrefslogtreecommitdiffstats
path: root/lib/bsearch.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2019-10-07 15:56:55 +0200
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2019-11-14 19:15:11 +0100
commite8877ec5dbba6f39d25ca3a81716c23b1760f2ee (patch)
treeb1782379be54e2b01fb5f4479be27ff756d6553c /lib/bsearch.c
parentlib/sort: Move swap, cmp and cmp_r function types for wider use (diff)
downloadlinux-e8877ec5dbba6f39d25ca3a81716c23b1760f2ee.tar.xz
linux-e8877ec5dbba6f39d25ca3a81716c23b1760f2ee.zip
lib/bsearch: Use generic type for comparator function
Comparator function type, cmp_func_t, is defined in the types.h, use it in bsearch() and, thus, add more sense to the corresponding comment in the code. Link: http://lkml.kernel.org/r/20191007135656.37734-2-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'lib/bsearch.c')
-rw-r--r--lib/bsearch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bsearch.c b/lib/bsearch.c
index 8baa83968162..8b3aae5ae77a 100644
--- a/lib/bsearch.c
+++ b/lib/bsearch.c
@@ -29,7 +29,7 @@
* the same comparison function for both sort() and bsearch().
*/
void *bsearch(const void *key, const void *base, size_t num, size_t size,
- int (*cmp)(const void *key, const void *elt))
+ cmp_func_t cmp)
{
const char *pivot;
int result;