Commit e6bfc753 authored by Dmitry Torokhov's avatar Dmitry Torokhov

Setup: introduce __obsolete_setup macro to denote truly obsolete

       parameters. Whenever such parameter is specified kernel
       will complain that "Parameter %s is obsolete, ignored"
parent 71021010
...@@ -110,12 +110,21 @@ struct obs_kernel_param { ...@@ -110,12 +110,21 @@ struct obs_kernel_param {
}; };
/* OBSOLETE: see moduleparam.h for the right way. */ /* OBSOLETE: see moduleparam.h for the right way. */
#define __setup(str, fn) \ #define __setup_param(str, unique_id, fn) \
static char __setup_str_##fn[] __initdata = str; \ static char __setup_str_##unique_id[] __initdata = str; \
static struct obs_kernel_param __setup_##fn \ static struct obs_kernel_param __setup_##unique_id \
__attribute_used__ \ __attribute_used__ \
__attribute__((__section__(".init.setup"))) \ __attribute__((__section__(".init.setup"))) \
= { __setup_str_##fn, fn } = { __setup_str_##unique_id, fn }
#define __setup_null_param(str, unique_id) \
__setup_param(str, unique_id, NULL)
#define __setup(str, fn) \
__setup_param(str, fn, fn)
#define __obsolete_setup(str) \
__setup_null_param(str, __LINE__)
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
...@@ -172,7 +181,10 @@ struct obs_kernel_param { ...@@ -172,7 +181,10 @@ struct obs_kernel_param {
{ return exitfn; } \ { return exitfn; } \
void cleanup_module(void) __attribute__((alias(#exitfn))); void cleanup_module(void) __attribute__((alias(#exitfn)));
#define __setup(str,func) /* nothing */ #define __setup_param(str, unique_id, fn) /* nothing */
#define __setup_null_param(str, unique_id) /* nothing */
#define __setup(str, func) /* nothing */
#define __obsolete_setup(str) /* nothing */
#endif #endif
/* Data marked not to be saved by software_suspend() */ /* Data marked not to be saved by software_suspend() */
......
...@@ -155,8 +155,11 @@ static int __init obsolete_checksetup(char *line) ...@@ -155,8 +155,11 @@ static int __init obsolete_checksetup(char *line)
p = &__setup_start; p = &__setup_start;
do { do {
int n = strlen(p->str); int n = strlen(p->str);
if (!strncmp(line,p->str,n)) { if (!strncmp(line, p->str, n)) {
if (p->setup_func(line+n)) if (!p->setup_func) {
printk(KERN_WARNING "Parameter %s is obsolete, ignored\n", p->str);
return 1;
} else if (p->setup_func(line + n))
return 1; return 1;
} }
p++; p++;
......
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