Skip to content

Commit

Permalink
kernel/param: consolidate __{start,stop}___param[] in <linux/modulepa…
Browse files Browse the repository at this point in the history
…ram.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>
  • Loading branch information
Geert Uytterhoeven authored and Linus Torvalds committed Oct 14, 2014
1 parent 4c6327d commit 63a12d9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions include/linux/moduleparam.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ struct kernel_param {
};
};

extern const struct kernel_param __start___param[], __stop___param[];

/* Special one for strings we want to copy into */
struct kparam_string {
unsigned int maxlen;
Expand Down
2 changes: 0 additions & 2 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,6 @@ asmlinkage __visible void __init start_kernel(void)
{
char *command_line;
char *after_dashes;
extern const struct kernel_param __start___param[], __stop___param[];

/*
* Need to run as early as possible, to initialize the
Expand Down Expand Up @@ -844,7 +843,6 @@ static char *initcall_level_names[] __initdata = {

static void __init do_initcall_level(int level)
{
extern const struct kernel_param __start___param[], __stop___param[];
initcall_t *fn;

strcpy(initcall_command_line, saved_command_line);
Expand Down
7 changes: 3 additions & 4 deletions kernel/params.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -513,8 +514,6 @@ EXPORT_SYMBOL(param_ops_string);
#define to_module_attr(n) container_of(n, struct module_attribute, attr)
#define to_module_kobject(n) container_of(n, struct module_kobject, kobj)

extern struct kernel_param __start___param[], __stop___param[];

struct param_attribute
{
struct module_attribute mattr;
Expand Down Expand Up @@ -774,7 +773,7 @@ static struct module_kobject * __init locate_module_kobject(const char *name)
}

static void __init kernel_add_sysfs_param(const char *name,
struct kernel_param *kparam,
const struct kernel_param *kparam,
unsigned int name_skip)
{
struct module_kobject *mk;
Expand Down Expand Up @@ -809,7 +808,7 @@ static void __init kernel_add_sysfs_param(const char *name,
*/
static void __init param_sysfs_builtin(void)
{
struct kernel_param *kp;
const struct kernel_param *kp;
unsigned int name_len;
char modname[MODULE_NAME_LEN];

Expand Down

0 comments on commit 63a12d9

Please sign in to comment.