Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kernel/param: consolidate __{start,stop}___param[] in <linux/moduleparam.h>

Consolidate the various external const and non-const declarations of
__start___param[] and __stop___param in <linux/moduleparam.h>. This
requires making a few struct kernel_param pointers in kernel/params.c
const.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Geert Uytterhoeven and committed by
Linus Torvalds
63a12d9d 4c6327df

+5 -6
+2
include/linux/moduleparam.h
··· 78 78 }; 79 79 }; 80 80 81 + extern const struct kernel_param __start___param[], __stop___param[]; 82 + 81 83 /* Special one for strings we want to copy into */ 82 84 struct kparam_string { 83 85 unsigned int maxlen;
-2
init/main.c
··· 501 501 { 502 502 char *command_line; 503 503 char *after_dashes; 504 - extern const struct kernel_param __start___param[], __stop___param[]; 505 504 506 505 /* 507 506 * Need to run as early as possible, to initialize the ··· 843 844 844 845 static void __init do_initcall_level(int level) 845 846 { 846 - extern const struct kernel_param __start___param[], __stop___param[]; 847 847 initcall_t *fn; 848 848 849 849 strcpy(initcall_command_line, saved_command_line);
+3 -4
kernel/params.c
··· 19 19 #include <linux/string.h> 20 20 #include <linux/errno.h> 21 21 #include <linux/module.h> 22 + #include <linux/moduleparam.h> 22 23 #include <linux/device.h> 23 24 #include <linux/err.h> 24 25 #include <linux/slab.h> ··· 514 513 #define to_module_attr(n) container_of(n, struct module_attribute, attr) 515 514 #define to_module_kobject(n) container_of(n, struct module_kobject, kobj) 516 515 517 - extern struct kernel_param __start___param[], __stop___param[]; 518 - 519 516 struct param_attribute 520 517 { 521 518 struct module_attribute mattr; ··· 773 774 } 774 775 775 776 static void __init kernel_add_sysfs_param(const char *name, 776 - struct kernel_param *kparam, 777 + const struct kernel_param *kparam, 777 778 unsigned int name_skip) 778 779 { 779 780 struct module_kobject *mk; ··· 808 809 */ 809 810 static void __init param_sysfs_builtin(void) 810 811 { 811 - struct kernel_param *kp; 812 + const struct kernel_param *kp; 812 813 unsigned int name_len; 813 814 char modname[MODULE_NAME_LEN]; 814 815