Commit 517acd7f authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Warn if module_param and MODULE_PARM mixed

From: Rusty Russell <rusty@rustcorp.com.au>

From: Pavel Roskin <proski@gnu.org>

If you use both module_param (new) and MODULE_PARM (obsolete) in a module,
only the second gets recognised.  Warn.
parent 5acb7574
...@@ -1543,6 +1543,10 @@ static struct module *load_module(void __user *umod, ...@@ -1543,6 +1543,10 @@ static struct module *load_module(void __user *umod,
/ sizeof(struct obsolete_modparm), / sizeof(struct obsolete_modparm),
sechdrs, symindex, sechdrs, symindex,
(char *)sechdrs[strindex].sh_addr); (char *)sechdrs[strindex].sh_addr);
if (setupindex)
printk(KERN_WARNING "%s: Ignoring new-style "
"parameters in presence of obsolete ones\n",
mod->name);
} else { } else {
/* Size of section 0 is 0, so this works well if no params */ /* Size of section 0 is 0, so this works well if no params */
err = parse_args(mod->name, mod->args, err = parse_args(mod->name, mod->args,
......
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