Re: [PATCH] module: Use binary search in lookup_symbol()

From: Anders Kaseorg
Date: Mon May 16 2011 - 14:02:18 EST


On Mon, May 16, 2011 at 11:36, Dirk Behme <dirk.behme@xxxxxxxxxxxxxx> wrote:
> Then, thinking again, results in the question if the first argument of
> bsearch() shouldn't be 'name' rather than 'ks->name'?

Yes, it should be.

> Then it would be the job of cmp_name() to check for start == stop == 0?

Actually bsearch already handles this case correctly (it will make no
calls to cmp_name and return NULL), so nothing needs to specially
check for it.

Anders
--
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/