mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [BUG] [2.5.49] symbol_get doesn't work
@ 2002-11-26  8:14 Wang, Stanley
  2002-11-26 23:27 ` Rusty Russell
  0 siblings, 1 reply; 11+ messages in thread
From: Wang, Stanley @ 2002-11-26  8:14 UTC (permalink / raw)
  To: 'linux-kernel@vger.kernel.org'; +Cc: 'rusty@rustcorp.com.au'

Hello,
I found the symbol_get()/symbol_put() didn't work on my 2.5.49 build.
I think the root cause is a wrong macro definition. The following patch
could 
fix this bug.

diff -Naur -X dontdiff linux-2.5.49/include/linux/module.h
linux-2.5.49-bugfix/include/linux/module.h
--- linux-2.5.49/include/linux/module.h	2002-11-26 16:06:36.000000000 +0800
+++ linux-2.5.49-bugfix/include/linux/module.h	2002-11-26
16:01:52.000000000 +0800
@@ -86,7 +86,7 @@
 /* Get/put a kernel symbol (calls must be symmetric) */
 void *__symbol_get(const char *symbol);
 void *__symbol_get_gpl(const char *symbol);
-#define symbol_get(x) ((typeof(&x))(__symbol_get(#x)))
+#define symbol_get(x) ((typeof(&x))(__symbol_get(x)))
 
 /* For every exported symbol, place a struct in the __ksymtab section */
 #define EXPORT_SYMBOL(sym)				\
@@ -166,7 +166,7 @@
 #ifdef CONFIG_MODULE_UNLOAD
 
 void __symbol_put(const char *symbol);
-#define symbol_put(x) __symbol_put(#x)
+#define symbol_put(x) __symbol_put(x)
 void symbol_put_addr(void *addr);
 
 /* We only need protection against local interrupts. */


Your Sincerely,
Stanley Wang 

SW Engineer, Intel Corporation.
Intel China Software Lab. 
Tel: 021-52574545 ext. 1171 
iNet: 8-752-1171 
 
Opinions expressed are those of the author and do not represent Intel
Corporation

^ permalink raw reply	[flat|nested] 11+ messages in thread
* RE: [BUG] [2.5.49] symbol_get doesn't work
@ 2002-11-27  1:30 Wang, Stanley
  2002-11-28  3:01 ` Rusty Russell
  0 siblings, 1 reply; 11+ messages in thread
From: Wang, Stanley @ 2002-11-27  1:30 UTC (permalink / raw)
  To: 'linux-kernel@vger.kernel.org'
  Cc: 'rusty@rustcorp.com.au', Zhuang, Louis

Sorry, my last patch would cause an incompatible type warning. The following
patch could do better.

diff -Naur -X dontdiff linux-2.5.49/include/linux/module.h
linux-2.5.49-bugfix/include/linux/module.h
--- linux-2.5.49/include/linux/module.h	2002-11-27 09:23:39.000000000 +0800
+++ linux-2.5.49-bugfix/include/linux/module.h	2002-11-27
09:23:54.000000000 +0800
@@ -86,7 +86,7 @@
 /* Get/put a kernel symbol (calls must be symmetric) */
 void *__symbol_get(const char *symbol);
 void *__symbol_get_gpl(const char *symbol);
-#define symbol_get(x) ((typeof(&x))(__symbol_get(#x)))
+#define symbol_get(t,x) ((typeof(t))(__symbol_get(#x)))
 
 /* For every exported symbol, place a struct in the __ksymtab section */
 #define EXPORT_SYMBOL(sym)				\



Thanks,
Stanley

> -----Original Message-----
> From: Wang, Stanley 
> Sent: 2002年11月26日 16:14
> To: 'linux-kernel@vger.kernel.org'
> Cc: 'rusty@rustcorp.com.au'
> Subject: [BUG] [2.5.49] symbol_get doesn't work
> 
> 
> Hello,
> I found the symbol_get()/symbol_put() didn't work on my 2.5.49 build.
> I think the root cause is a wrong macro definition. The 
> following patch could 
> fix this bug.
> 
> diff -Naur -X dontdiff linux-2.5.49/include/linux/module.h 
> linux-2.5.49-bugfix/include/linux/module.h
> --- linux-2.5.49/include/linux/module.h	2002-11-26 
> 16:06:36.000000000 +0800
> +++ linux-2.5.49-bugfix/include/linux/module.h	
> 2002-11-26 16:01:52.000000000 +0800
> @@ -86,7 +86,7 @@
>  /* Get/put a kernel symbol (calls must be symmetric) */
>  void *__symbol_get(const char *symbol);
>  void *__symbol_get_gpl(const char *symbol);
> -#define symbol_get(x) ((typeof(&x))(__symbol_get(#x)))
> +#define symbol_get(x) ((typeof(&x))(__symbol_get(x)))
>  
>  /* For every exported symbol, place a struct in the 
> __ksymtab section */
>  #define EXPORT_SYMBOL(sym)				\
> @@ -166,7 +166,7 @@
>  #ifdef CONFIG_MODULE_UNLOAD
>  
>  void __symbol_put(const char *symbol);
> -#define symbol_put(x) __symbol_put(#x)
> +#define symbol_put(x) __symbol_put(x)
>  void symbol_put_addr(void *addr);
>  
>  /* We only need protection against local interrupts. */
> 
> 
> Your Sincerely,
> Stanley Wang 
> 
> SW Engineer, Intel Corporation.
> Intel China Software Lab. 
> Tel: 021-52574545 ext. 1171 
> iNet: 8-752-1171 
>  
> Opinions expressed are those of the author and do not 
> represent Intel Corporation
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <957BD1C2BF3CD411B6C500A0C944CA2601F116A1@pdsmsx32.pd.intel.com>]

end of thread, other threads:[~2002-11-29  3:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-26  8:14 [BUG] [2.5.49] symbol_get doesn't work Wang, Stanley
2002-11-26 23:27 ` Rusty Russell
2002-11-27 23:19   ` Rusty Lynch
2002-11-28 23:42     ` Rusty Russell
2002-11-29  1:31       ` Miles Bader
2002-11-29  2:02         ` Sean Neakums
2002-11-29  2:11           ` Miles Bader
2002-11-29  3:29         ` Rusty Russell
2002-11-27  1:30 Wang, Stanley
2002-11-28  3:01 ` Rusty Russell
     [not found] <957BD1C2BF3CD411B6C500A0C944CA2601F116A1@pdsmsx32.pd.intel.com>
2002-11-29  0:01 ` Rusty Russell

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

Powered by JetHome