[PATCH] module: fix fallout from alignment patch

From: Dmitry Torokhov
Date: Fri Feb 11 2011 - 03:34:25 EST


Signed-off-by: Dmitry Torokhov <dtor@xxxxxxxxxx>
---
include/linux/module.h | 2 +-
include/linux/moduleparam.h | 10 +++++-----
init/main.c | 2 +-
kernel/module.c | 2 +-
kernel/params.c | 35 +++++++++++++++++++----------------
5 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/include/linux/module.h b/include/linux/module.h
index cb41837..c256380 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -292,7 +292,7 @@ struct module
unsigned int num_syms;

/* Kernel parameters. */
- struct kernel_param *kp;
+ const struct kernel_param **kp;
unsigned int num_kp;

/* GPL-only exported symbols. */
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 05b92c0..75c5dad 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -267,15 +267,15 @@ static inline void __kernel_param_unlock(void)
/* Called on module insert or kernel boot */
extern int parse_args(const char *name,
char *args,
- const struct kernel_param *params,
+ const struct kernel_param **params,
unsigned num,
int (*unknown)(char *param, char *val));

/* Called by module remove. */
#ifdef CONFIG_SYSFS
-extern void destroy_params(const struct kernel_param *params, unsigned num);
+extern void destroy_params(const struct kernel_param **params, unsigned num);
#else
-static inline void destroy_params(const struct kernel_param *params,
+static inline void destroy_params(const struct kernel_param **params,
unsigned num)
{
}
@@ -393,13 +393,13 @@ struct module;

#if defined(CONFIG_SYSFS) && defined(CONFIG_MODULES)
extern int module_param_sysfs_setup(struct module *mod,
- const struct kernel_param *kparam,
+ const struct kernel_param **kparam,
unsigned int num_params);

extern void module_param_sysfs_remove(struct module *mod);
#else
static inline int module_param_sysfs_setup(struct module *mod,
- const struct kernel_param *kparam,
+ const struct kernel_param **kparam,
unsigned int num_params)
{
return 0;
diff --git a/init/main.c b/init/main.c
index 33c37c3..3601586 100644
--- a/init/main.c
+++ b/init/main.c
@@ -544,7 +544,7 @@ static void __init mm_init(void)
asmlinkage void __init start_kernel(void)
{
char * command_line;
- extern const struct kernel_param __start___param[], __stop___param[];
+ extern const struct kernel_param *__start___param[], *__stop___param[];

smp_setup_processor_id();

diff --git a/kernel/module.c b/kernel/module.c
index efa290e..7c6c3bf 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1470,7 +1470,7 @@ out:

static int mod_sysfs_setup(struct module *mod,
const struct load_info *info,
- struct kernel_param *kparam,
+ const struct kernel_param **kparam,
unsigned int num_params)
{
int err;
diff --git a/kernel/params.c b/kernel/params.c
index 66f7e66..4f2eb43 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -83,9 +83,9 @@ static inline int parameq(const char *input, const char *paramname)
return 0;
}

-static int parse_one(char *param,
+static int parse_one(char *name,
char *val,
- const struct kernel_param *params,
+ const struct kernel_param **params,
unsigned num_params,
int (*handle_unknown)(char *param, char *val))
{
@@ -94,14 +94,16 @@ static int parse_one(char *param,

/* Find parameter */
for (i = 0; i < num_params; i++) {
- if (parameq(param, params[i].name)) {
+ const struct kernel_param *param = params[i];
+
+ if (parameq(name, param->name)) {
/* Noone handled NULL, so do it here. */
- if (!val && params[i].ops->set != param_set_bool)
+ if (!val && param->ops->set != param_set_bool)
return -EINVAL;
DEBUGP("They are equal! Calling %p\n",
- params[i].ops->set);
+ param->ops->set);
mutex_lock(&param_lock);
- err = params[i].ops->set(val, &params[i]);
+ err = param->ops->set(val, param);
mutex_unlock(&param_lock);
return err;
}
@@ -109,7 +111,7 @@ static int parse_one(char *param,

if (handle_unknown) {
DEBUGP("Unknown argument: calling %p\n", handle_unknown);
- return handle_unknown(param, val);
+ return handle_unknown(name, val);
}

DEBUGP("Unknown argument `%s'\n", param);
@@ -171,7 +173,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,
- const struct kernel_param *params,
+ const struct kernel_param **params,
unsigned num,
int (*unknown)(char *param, char *val))
{
@@ -190,8 +192,9 @@ int parse_args(const char *name,
irq_was_disabled = irqs_disabled();
ret = parse_one(param, val, params, num, unknown);
if (irq_was_disabled && !irqs_disabled()) {
- printk(KERN_WARNING "parse_args(): option '%s' enabled "
- "irq's!\n", param);
+ printk(KERN_WARNING
+ "parse_args(): option '%s' enabled irq's!\n",
+ param);
}
switch (ret) {
case -ENOENT:
@@ -668,16 +671,16 @@ static void free_module_param_attrs(struct module_kobject *mk)
* /sys/module/[mod->name]/parameters/
*/
int module_param_sysfs_setup(struct module *mod,
- const struct kernel_param *kparam,
+ const struct kernel_param **kparam,
unsigned int num_params)
{
int i, err;
bool params = false;

for (i = 0; i < num_params; i++) {
- if (kparam[i].perm == 0)
+ if (kparam[i]->perm == 0)
continue;
- err = add_sysfs_param(&mod->mkobj, &kparam[i], kparam[i].name);
+ err = add_sysfs_param(&mod->mkobj, kparam[i], kparam[i]->name);
if (err)
return err;
params = true;
@@ -711,13 +714,13 @@ void module_param_sysfs_remove(struct module *mod)
}
#endif

-void destroy_params(const struct kernel_param *params, unsigned num)
+void destroy_params(const struct kernel_param **params, unsigned num)
{
unsigned int i;

for (i = 0; i < num; i++)
- if (params[i].ops->free)
- params[i].ops->free(params[i].arg);
+ if (params[i]->ops->free)
+ params[i]->ops->free(params[i]->arg);
}

static struct module_kobject * __init locate_module_kobject(const char *name)
--
1.7.3.2


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/