]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Parameter implementation for modules
authorRusty Russell <rusty@rustcorp.com.au>
Sun, 15 Dec 2002 04:13:17 +0000 (20:13 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sun, 15 Dec 2002 04:13:17 +0000 (20:13 -0800)
This activates parameter parsing for module_param() declarations in modules.

kernel/module.c

index 53f4467acd3c354b0b67663355570cb7d7b75e0c..ac0c424fce0b69896f80d3e1feda80891149a070 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/fcntl.h>
 #include <linux/rcupdate.h>
 #include <linux/cpu.h>
+#include <linux/moduleparam.h>
 #include <asm/uaccess.h>
 #include <asm/semaphore.h>
 #include <asm/pgalloc.h>
@@ -900,7 +901,7 @@ static struct module *load_module(void *umod,
                        /* Strings */
                        DEBUGP("String table found in section %u\n", i);
                        strindex = i;
-               } else if (strcmp(secstrings+sechdrs[i].sh_name, ".setup.init")
+               } else if (strcmp(secstrings+sechdrs[i].sh_name, "__param")
                           == 0) {
                        /* Setup parameter info */
                        DEBUGP("Setup table found in section %u\n", i);
@@ -1048,8 +1049,7 @@ static struct module *load_module(void *umod,
        if (err < 0)
                goto cleanup;
 
-#if 0 /* Needs param support */
-       /* Size of section 0 is 0, so this works well */
+       /* Size of section 0 is 0, so this works well if no params */
        err = parse_args(mod->args,
                         (struct kernel_param *)
                         sechdrs[setupindex].sh_offset,
@@ -1058,7 +1058,6 @@ static struct module *load_module(void *umod,
                         NULL);
        if (err < 0)
                goto cleanup;
-#endif
 
        /* Get rid of temporary copy */
        vfree(hdr);