Re: [BUG] [2.5.49] symbol_get doesn't work

Rusty Russell (rusty@rustcorp.com.au)
Thu, 28 Nov 2002 14:01:23 +1100


In message <957BD1C2BF3CD411B6C500A0C944CA2601F11699@pdsmsx32.pd.intel.com> you
write:
> 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)))
> =20
> /* For every exported symbol, place a struct in the __ksymtab section =
> */
> #define EXPORT_SYMBOL(sym) \

Hmm, I still don't think you are using it correctly. You have to know
the type of the object you are grabbing, right? Then you might as
well give it a declaration, no? Preferably in a header somewhere.

Hope that helps,
Rusty.

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/