aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2014-10-13 18:55:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-13 20:18:28 -0400
commit63a12d9d01831208a47f5c0fbbf93f503d1fb162 (patch)
tree2df74c48943740a6ad83d9909837512eaf0c2353
parent4c6327dfaf20d6207efa765320748fd8699f74b0 (diff)
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>
-rw-r--r--include/linux/moduleparam.h2
-rw-r--r--init/main.c2
-rw-r--r--kernel/params.c7
3 files changed, 5 insertions, 6 deletions
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index b43f4752304e..1c9effa25e26 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -78,6 +78,8 @@ struct kernel_param {
78 }; 78 };
79}; 79};
80 80
81extern const struct kernel_param __start___param[], __stop___param[];
82
81/* Special one for strings we want to copy into */ 83/* Special one for strings we want to copy into */
82struct kparam_string { 84struct kparam_string {
83 unsigned int maxlen; 85 unsigned int maxlen;
diff --git a/init/main.c b/init/main.c
index 89ec862da2d4..800a0daede7e 100644
--- a/init/main.c
+++ b/init/main.c
@@ -501,7 +501,6 @@ asmlinkage __visible void __init start_kernel(void)
501{ 501{
502 char *command_line; 502 char *command_line;
503 char *after_dashes; 503 char *after_dashes;
504 extern const struct kernel_param __start___param[], __stop___param[];
505 504
506 /* 505 /*
507 * Need to run as early as possible, to initialize the 506 * Need to run as early as possible, to initialize the
@@ -844,7 +843,6 @@ static char *initcall_level_names[] __initdata = {
844 843
845static void __init do_initcall_level(int level) 844static void __init do_initcall_level(int level)
846{ 845{
847 extern const struct kernel_param __start___param[], __stop___param[];
848 initcall_t *fn; 846 initcall_t *fn;
849 847
850 strcpy(initcall_command_line, saved_command_line); 848 strcpy(initcall_command_line, saved_command_line);
diff --git a/kernel/params.c b/kernel/params.c
index 041b5899d5e2..db97b791390f 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -19,6 +19,7 @@
19#include <linux/string.h> 19#include <linux/string.h>
20#include <linux/errno.h> 20#include <linux/errno.h>
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/moduleparam.h>
22#include <linux/device.h> 23#include <linux/device.h>
23#include <linux/err.h> 24#include <linux/err.h>
24#include <linux/slab.h> 25#include <linux/slab.h>
@@ -513,8 +514,6 @@ EXPORT_SYMBOL(param_ops_string);
513#define to_module_attr(n) container_of(n, struct module_attribute, attr) 514#define to_module_attr(n) container_of(n, struct module_attribute, attr)
514#define to_module_kobject(n) container_of(n, struct module_kobject, kobj) 515#define to_module_kobject(n) container_of(n, struct module_kobject, kobj)
515 516
516extern struct kernel_param __start___param[], __stop___param[];
517
518struct param_attribute 517struct param_attribute
519{ 518{
520 struct module_attribute mattr; 519 struct module_attribute mattr;
@@ -774,7 +773,7 @@ static struct module_kobject * __init locate_module_kobject(const char *name)
774} 773}
775 774
776static void __init kernel_add_sysfs_param(const char *name, 775static void __init kernel_add_sysfs_param(const char *name,
777 struct kernel_param *kparam, 776 const struct kernel_param *kparam,
778 unsigned int name_skip) 777 unsigned int name_skip)
779{ 778{
780 struct module_kobject *mk; 779 struct module_kobject *mk;
@@ -809,7 +808,7 @@ static void __init kernel_add_sysfs_param(const char *name,
809 */ 808 */
810static void __init param_sysfs_builtin(void) 809static void __init param_sysfs_builtin(void)
811{ 810{
812 struct kernel_param *kp; 811 const struct kernel_param *kp;
813 unsigned int name_len; 812 unsigned int name_len;
814 char modname[MODULE_NAME_LEN]; 813 char modname[MODULE_NAME_LEN];
815 814