All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] module: Use binary search in lookup_symbol()
@ 2011-05-03 20:42 Alessio Igor Bogani
  2011-05-04 15:34 ` Dirk Behme
  2011-05-16 15:36 ` Dirk Behme
  0 siblings, 2 replies; 31+ messages in thread
From: Alessio Igor Bogani @ 2011-05-03 20:42 UTC (permalink / raw)
  To: Rusty Russell
  Cc: Tim Abbott, Anders Kaseorg, Tim Bird, LKML, Linux Embedded,
	Jason Wessel, Alessio Igor Bogani

This work was supported by a hardware donation from the CE Linux Forum.

Signed-off-by: Alessio Igor Bogani <abogani@kernel.org>
---
 kernel/module.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index 6a34337..a1f841e 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2055,10 +2055,8 @@ static const struct kernel_symbol *lookup_symbol(const char *name,
 	const struct kernel_symbol *stop)
 {
 	const struct kernel_symbol *ks = start;
-	for (; ks < stop; ks++)
-		if (strcmp(ks->name, name) == 0)
-			return ks;
-	return NULL;
+	return bsearch(ks->name, start, stop - start,
+			sizeof(struct kernel_symbol), cmp_name);
 }
 
 static int is_exported(const char *name, unsigned long value,
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2011-05-21 14:23 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-03 20:42 [PATCH] module: Use binary search in lookup_symbol() Alessio Igor Bogani
2011-05-04 15:34 ` Dirk Behme
2011-05-04 17:30   ` Alessio Igor Bogani
2011-05-16 15:36 ` Dirk Behme
2011-05-16 18:02   ` Anders Kaseorg
2011-05-16 20:23     ` Alessio Igor Bogani
2011-05-16 21:01       ` Joe Perches
2011-05-16 21:08         ` Joe Perches
2011-05-17  3:52       ` Rusty Russell
2011-05-17 19:18         ` Dirk Behme
2011-05-17 19:41           ` Alessio Igor Bogani
2011-05-17 20:56             ` Alessio Igor Bogani
2011-05-17 23:22               ` Greg KH
2011-05-17 23:33                 ` Tim Bird
2011-05-18  7:54                   ` Christoph Hellwig
2011-05-18 17:00                     ` Tim Bird
2011-05-18 19:21                       ` Greg KH
2011-05-18 21:10                         ` module boot time (was Re: [PATCH] module: Use binary search in lookup_symbol()) Tim Bird
2011-05-18 21:34                           ` Greg KH
2011-05-19 19:56                             ` Jeff Mahoney
2011-05-20 21:29                               ` Tim Bird
2011-05-21 14:23                                 ` Jeff Mahoney
2011-05-18 18:55                   ` Alessio Igor Bogani
2011-05-18 18:55                     ` (unknown), Alessio Igor Bogani
2011-05-18 19:22                     ` your mail Greg KH
2011-05-18 20:35                       ` Alessio Igor Bogani
2011-05-18 20:35                         ` [PATCH] module: Use binary search in lookup_symbol() Alessio Igor Bogani
2011-05-18  1:07                 ` Rusty Russell
2011-05-18 15:26               ` Dirk Behme
2011-05-19  7:26                 ` Rusty Russell
2011-05-18  1:10           ` Rusty Russell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.