aboutsummaryrefslogtreecommitdiff
path: root/lib/bsearch.c
AgeCommit message (Collapse)AuthorFilesLines
2012-03-07lib: reduce the use of module.h wherever possiblePaul Gortmaker1-1/+1
For files only using THIS_MODULE and/or EXPORT_SYMBOL, map them onto including export.h -- or if the file isn't even using those, then just delete the include. Fix up any implicit include dependencies that were being masked by module.h along the way. Signed-off-by: Paul Gortmaker <[email protected]>
2011-05-19lib: Add generic binary search function to the kernel.Tim Abbott1-0/+53
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 protected]> Extra-bikeshedding-by: Alan Jenkins <[email protected]> Extra-bikeshedding-by: AndrĂ© Goddard Rosa <[email protected]> Extra-bikeshedding-by: Rusty Russell <[email protected]> Signed-off-by: Rusty Russell <[email protected]> Signed-off-by: Alessio Igor Bogani <[email protected]> Signed-off-by: Rusty Russell <[email protected]>