param: make param sections const.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 12 Aug 2010 05:04:18 +0000 (23:04 -0600)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 11 Aug 2010 13:34:19 +0000 (23:04 +0930)
Since this section can be read-only (they're in .rodata), they should
always have been const.  Minor flow-through various functions.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Tested-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
include/linux/moduleparam.h
init/main.c
kernel/params.c

index 9f51568f51c82a334d496ca63206c0804e611d6d..6d48831fe7d2856815caad258bceb29815290a51 100644 (file)
@@ -161,7 +161,7 @@ __check_old_set_param(int (*oldset)(const char *, struct kernel_param *))
 /* Called on module insert or kernel boot */
 extern int parse_args(const char *name,
                      char *args,
-                     struct kernel_param *params,
+                     const struct kernel_param *params,
                      unsigned num,
                      int (*unknown)(char *param, char *val));
 
index 86cbfd085b0127b986f73b36a7ab6f7221e1fe79..22d61cb06f98ab6fc31333213477197e93394416 100644 (file)
@@ -201,11 +201,11 @@ static char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, };
 char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, };
 static const char *panic_later, *panic_param;
 
-extern struct obs_kernel_param __setup_start[], __setup_end[];
+extern const struct obs_kernel_param __setup_start[], __setup_end[];
 
 static int __init obsolete_checksetup(char *line)
 {
-       struct obs_kernel_param *p;
+       const struct obs_kernel_param *p;
        int had_early_param = 0;
 
        p = __setup_start;
@@ -458,7 +458,7 @@ static noinline void __init_refok rest_init(void)
 /* Check for early params. */
 static int __init do_early_param(char *param, char *val)
 {
-       struct obs_kernel_param *p;
+       const struct obs_kernel_param *p;
 
        for (p = __setup_start; p < __setup_end; p++) {
                if ((p->early && strcmp(param, p->str) == 0) ||
@@ -536,7 +536,7 @@ static void __init mm_init(void)
 asmlinkage void __init start_kernel(void)
 {
        char * command_line;
-       extern struct kernel_param __start___param[], __stop___param[];
+       extern const struct kernel_param __start___param[], __stop___param[];
 
        smp_setup_processor_id();
 
index ef60db14fae0f67eb1734ccbf1bd96abe86d63d7..a3eeeefc947201eda6e3ebbfa45e17d0ec18eeb4 100644 (file)
@@ -88,7 +88,7 @@ static inline int parameq(const char *input, const char *paramname)
 
 static int parse_one(char *param,
                     char *val,
-                    struct kernel_param *params, 
+                    const struct kernel_param *params,
                     unsigned num_params,
                     int (*handle_unknown)(char *param, char *val))
 {
@@ -170,7 +170,7 @@ static char *next_arg(char *args, char **param, char **val)
 /* Args looks like "foo=bar,bar2 baz=fuz wiz". */
 int parse_args(const char *name,
               char *args,
-              struct kernel_param *params,
+              const struct kernel_param *params,
               unsigned num,
               int (*unknown)(char *param, char *val))
 {