1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_BSEARCH_H
3 #define _LINUX_BSEARCH_H
5 #include <linux/types.h>
8 void *__inline_bsearch(const void *key
, const void *base
, size_t num
, size_t size
, cmp_func_t cmp
)
14 pivot
= base
+ (num
>> 1) * size
;
15 result
= cmp(key
, pivot
);
30 extern void *bsearch(const void *key
, const void *base
, size_t num
, size_t size
, cmp_func_t cmp
);
32 #endif /* _LINUX_BSEARCH_H */