module: fix linker error for MODULE_VERSION when !MODULE and CONFIG_SYSFS=n
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 24 Jan 2011 20:32:51 +0000 (14:32 -0600)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 24 Jan 2011 04:02:52 +0000 (14:32 +1030)
lib/built-in.o:(__modver+0x8): undefined reference to `__modver_version_show'
lib/built-in.o:(__modver+0x2c): undefined reference to `__modver_version_show'

Simplest to just not emit anything: if they've disabled SYSFS they probably
want the smallest kernel possible.

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
include/linux/module.h

index 50efcd3..e7c6385 100644 (file)
@@ -168,7 +168,7 @@ extern struct module __this_module;
   local headers in "srcversion".
 */
 
-#ifdef MODULE
+#if defined(MODULE) || !defined(CONFIG_SYSFS)
 #define MODULE_VERSION(_version) MODULE_INFO(version, _version)
 #else
 #define MODULE_VERSION(_version)                                       \