lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ