|author||Tim Abbott <email@example.com>||2011-04-14 20:00:19 +0200|
|committer||Rusty Russell <firstname.lastname@example.org>||2011-05-19 16:55:27 +0930|
lib: Add generic binary search function to the kernel.
There a large number hand-coded binary searches in the kernel (run "git grep search | grep binary" to find many of them). Since in my experience, hand-coding binary searches can be error-prone, it seems worth cleaning this up by providing a generic binary search function. This generic binary search implementation comes from Ksplice. It has the same basic API as the C library bsearch() function. Ksplice uses it in half a dozen places with 4 different comparison functions, and I think our code is substantially cleaner because of this. Signed-off-by: Tim Abbott <email@example.com> Extra-bikeshedding-by: Alan Jenkins <firstname.lastname@example.org> Extra-bikeshedding-by: André Goddard Rosa <email@example.com> Extra-bikeshedding-by: Rusty Russell <firstname.lastname@example.org> Signed-off-by: Rusty Russell <email@example.com> Signed-off-by: Alessio Igor Bogani <firstname.lastname@example.org> Signed-off-by: Rusty Russell <email@example.com>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions