Re: [PATCH v4 1/5] util_macros.h: add find_closest() macro

From: Andrew Morton
Date: Fri Mar 20 2015 - 16:49:40 EST


On Thu, 19 Mar 2015 18:27:41 +0100 Bartosz Golaszewski <bgolaszewski@xxxxxxxxxxxx> wrote:

> Searching for the member of an array closest to 'x' is
> duplicated in several places.

Linear search is pretty nasty. lib/bsearch.c could do this
with a bit of tweaking. But that's a separate project.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/