[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200911041901.26722.rusty@rustcorp.com.au>
Date: Wed, 4 Nov 2009 19:01:26 +1030
From: Rusty Russell <rusty@...tcorp.com.au>
To: Alan Jenkins <alan-jenkins@...fmail.co.uk>
Cc: greg@...ah.com, linux-kbuild@...r.kernel.org, carmelo73@...il.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 09/10] module: speed up find_symbol() using binary search on the builtin symbol tables
On Tue, 3 Nov 2009 08:36:21 pm Alan Jenkins wrote:
> + for (type = 0; type < EXPORT_TYPE_MAX; type++) {
> + sym = bsearch(name, ksymtab[type].syms, ksymtab[type].num_syms,
> + sizeof(struct kernel_symbol), symbol_compare);
One minor point: Prefer ARRAY_SIZE() here to EXPORT_TYPE_MAX.
It'd be cool if bsearch was typesafe, but that would freak out the Old School
kernel hackers :)
> + for (type = 0; type < EXPORT_TYPE_MAX; type++) {
> + for (i = 0; i < symtab[type].num_syms; i++) {
> + sym = &symtab[type].syms[i];
Same.
Thanks!
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists