public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] kernel/module.c: fix a build warning
@ 2008-07-24 14:41 WANG Cong
  2008-07-25  1:48 ` Rusty Russell
  0 siblings, 1 reply; 2+ messages in thread
From: WANG Cong @ 2008-07-24 14:41 UTC (permalink / raw)
  To: LKML; +Cc: rusty


This patch fixed the warning:

  CC      kernel/module.o
  /home/wangcong/Projects/linux-2.6/kernel/module.c:332: warning:
‘lookup_symbol’ defined but not used


Signed-off-by: WANG Cong <wangcong@zeuux.org>
Cc: rusty@rustcorp.com.au

---
diff --git a/kernel/module.c b/kernel/module.c
index d8b5605..d861bd5 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -325,18 +325,6 @@ static unsigned long find_symbol(const char *name,
 	return -ENOENT;
 }
 
-/* lookup symbol in given range of kernel_symbols */
-static const struct kernel_symbol *lookup_symbol(const char *name,
-	const struct kernel_symbol *start,
-	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;
-}
-
 /* Search for module by name: must hold module_mutex. */
 static struct module *find_module(const char *name)
 {
@@ -1703,6 +1691,19 @@ static void setup_modinfo(struct module *mod, Elf_Shdr *sechdrs,
 }
 
 #ifdef CONFIG_KALLSYMS
+
+/* lookup symbol in given range of kernel_symbols */
+static const struct kernel_symbol *lookup_symbol(const char *name,
+	const struct kernel_symbol *start,
+	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;
+}
+
 static int is_exported(const char *name, const struct module *mod)
 {
 	if (!mod && lookup_symbol(name, __start___ksymtab, __stop___ksymtab))

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

* Re: [Patch] kernel/module.c: fix a build warning
  2008-07-24 14:41 [Patch] kernel/module.c: fix a build warning WANG Cong
@ 2008-07-25  1:48 ` Rusty Russell
  0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2008-07-25  1:48 UTC (permalink / raw)
  To: WANG Cong; +Cc: LKML

On Friday 25 July 2008 00:41:48 WANG Cong wrote:
> This patch fixed the warning:
>
>   CC      kernel/module.o
>   /home/wangcong/Projects/linux-2.6/kernel/module.c:332: warning:
> ‘lookup_symbol’ defined but not used
>
>
> Signed-off-by: WANG Cong <wangcong@zeuux.org>
> Cc: rusty@rustcorp.com.au

Thanks, applied!

Rusty.

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

end of thread, other threads:[~2008-07-25  1:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-24 14:41 [Patch] kernel/module.c: fix a build warning WANG Cong
2008-07-25  1:48 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox