summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/linux/module.h7
-rw-r--r--kernel/module.c17
2 files changed, 7 insertions, 17 deletions
diff --git a/include/linux/module.h b/include/linux/module.h
index 3a411c8c6575..ebdfc27efbb8 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -285,7 +285,9 @@ static inline const char *module_address_lookup(unsigned long addr,
}
#endif /* CONFIG_MODULES */
-#if defined(MODULE) && defined(KBUILD_MODNAME)
+#ifdef MODULE
+extern struct module __this_module;
+#ifdef KBUILD_MODNAME
/* We make the linker do some of the work. */
struct module __this_module
__attribute__((section(".gnu.linkonce.this_module"))) = {
@@ -296,7 +298,8 @@ __attribute__((section(".gnu.linkonce.this_module"))) = {
.exit = cleanup_module,
#endif
};
-#endif /* MODULE && KBUILD_MODNAME */
+#endif /* KBUILD_MODNAME */
+#endif /* MODULE */
/* For archs to search exception tables */
extern struct list_head extables;
diff --git a/kernel/module.c b/kernel/module.c
index 4b789cf97f5d..c33aac2d23b9 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -569,20 +569,6 @@ static int param_set_byte(const char *val, struct kernel_param *kp)
return 0;
}
-static int param_string(const char *name, const char *val,
- unsigned int min, unsigned int max,
- char *dest)
-{
- if (strlen(val) < min || strlen(val) > max) {
- printk(KERN_ERR
- "Parameter %s length must be %u-%u characters\n",
- name, min, max);
- return -EINVAL;
- }
- strcpy(dest, val);
- return 0;
-}
-
extern int set_obsolete(const char *val, struct kernel_param *kp)
{
unsigned int min, max;
@@ -618,7 +604,8 @@ extern int set_obsolete(const char *val, struct kernel_param *kp)
return param_array(kp->name, val, min, max, obsparm->addr,
sizeof(long), param_set_long);
case 's':
- return param_string(kp->name, val, min, max, obsparm->addr);
+ return param_array(kp->name, val, min, max, obsparm->addr,
+ sizeof(char *), param_set_charp);
}
printk(KERN_ERR "Unknown obsolete parameter type %s\n", obsparm->type);
return -EINVAL;