backports: ifdef around module_init() module_exit() for modules
authorLuis R. Rodriguez <mcgrof@suse.com>
Fri, 31 Oct 2014 20:17:27 +0000 (13:17 -0700)
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>
Fri, 14 Nov 2014 21:47:15 +0000 (13:47 -0800)
We only need this for modules.

Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
backport/backport-include/linux/module.h

index 82c96bd6b85e6b01b0f7c3686bf5eacac44b4990..e8f28b1c624035eec78f10255873265945de6136 100644 (file)
@@ -25,6 +25,7 @@ extern void backport_dependency_symbol(void);
                       " using backports " BACKPORTS_VERSION);
 #endif
 
+#ifdef MODULE
 #undef module_init
 #define module_init(initfn)                                            \
        static int __init __init_backport(void)                         \
@@ -58,6 +59,7 @@ extern void backport_dependency_symbol(void);
                rcu_barrier();                                          \
        }                                                               \
        void cleanup_module(void) __attribute__((alias("__exit_compat")));
+#endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
 #undef param_check_bool