Commit 914dcaa8 authored by Rusty Russell's avatar Rusty Russell

param: make param sections const.

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: default avatarRusty Russell <rusty@rustcorp.com.au>
Tested-by: default avatarPhil Carmody <ext-phil.2.carmody@nokia.com>
parent a1054322
...@@ -161,7 +161,7 @@ __check_old_set_param(int (*oldset)(const char *, struct kernel_param *)) ...@@ -161,7 +161,7 @@ __check_old_set_param(int (*oldset)(const char *, struct kernel_param *))
/* Called on module insert or kernel boot */ /* Called on module insert or kernel boot */
extern int parse_args(const char *name, extern int parse_args(const char *name,
char *args, char *args,
struct kernel_param *params, const struct kernel_param *params,
unsigned num, unsigned num,
int (*unknown)(char *param, char *val)); int (*unknown)(char *param, char *val));
......
...@@ -201,11 +201,11 @@ static char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, }; ...@@ -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, }; char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, };
static const char *panic_later, *panic_param; 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) static int __init obsolete_checksetup(char *line)
{ {
struct obs_kernel_param *p; const struct obs_kernel_param *p;
int had_early_param = 0; int had_early_param = 0;
p = __setup_start; p = __setup_start;
...@@ -458,7 +458,7 @@ static noinline void __init_refok rest_init(void) ...@@ -458,7 +458,7 @@ static noinline void __init_refok rest_init(void)
/* Check for early params. */ /* Check for early params. */
static int __init do_early_param(char *param, char *val) 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++) { for (p = __setup_start; p < __setup_end; p++) {
if ((p->early && strcmp(param, p->str) == 0) || if ((p->early && strcmp(param, p->str) == 0) ||
...@@ -536,7 +536,7 @@ static void __init mm_init(void) ...@@ -536,7 +536,7 @@ static void __init mm_init(void)
asmlinkage void __init start_kernel(void) asmlinkage void __init start_kernel(void)
{ {
char * command_line; char * command_line;
extern struct kernel_param __start___param[], __stop___param[]; extern const struct kernel_param __start___param[], __stop___param[];
smp_setup_processor_id(); smp_setup_processor_id();
......
...@@ -88,7 +88,7 @@ static inline int parameq(const char *input, const char *paramname) ...@@ -88,7 +88,7 @@ static inline int parameq(const char *input, const char *paramname)
static int parse_one(char *param, static int parse_one(char *param,
char *val, char *val,
struct kernel_param *params, const struct kernel_param *params,
unsigned num_params, unsigned num_params,
int (*handle_unknown)(char *param, char *val)) int (*handle_unknown)(char *param, char *val))
{ {
...@@ -170,7 +170,7 @@ static char *next_arg(char *args, 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". */ /* Args looks like "foo=bar,bar2 baz=fuz wiz". */
int parse_args(const char *name, int parse_args(const char *name,
char *args, char *args,
struct kernel_param *params, const struct kernel_param *params,
unsigned num, unsigned num,
int (*unknown)(char *param, char *val)) int (*unknown)(char *param, char *val))
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment