[lkml]   [2003]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] v850 obsolete params fix
Linus, please apply.  No variable arrays anywhere.


Name: Make obsolete module parameters work with MODULE_SYMBOL_PREFIX
Author: Rusty Russell, Miles Bader
Status: Trivial

D: Since these are just symbols in the module object, they need symbol name
D: munging to find the symbol from the parameter name.

diff -urNp --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5-bk/kernel/module.c working-2.5-bk-obsparm-symprefix/kernel/module.c
--- linux-2.5-bk/kernel/module.c Fri Jan 10 10:55:43 2003
+++ working-2.5-bk-obsparm-symprefix/kernel/module.c Mon Jan 13 14:35:01 2003
@@ -679,19 +679,19 @@ static int obsolete_params(const char *n
if (!kp)
return -ENOMEM;

- DEBUGP("Module %s has %u obsolete params\n", name, num);
- for (i = 0; i < num; i++)
- DEBUGP("Param %i: %s type %s\n",
- num, obsparm[i].name, obsparm[i].type);
for (i = 0; i < num; i++) {
+ char sym_name[128 + sizeof(MODULE_SYMBOL_PREFIX)];
+ snprintf(sym_name, sizeof(sym_name), "%s%s",
+ MODULE_SYMBOL_PREFIX, obsparm[i].name);
kp[i].name = obsparm[i].name;
kp[i].perm = 000;
kp[i].set = set_obsolete;
kp[i].get = NULL;
= (void *)find_local_symbol(sechdrs, symindex, strtab,
- obsparm[i].name);
+ sym_name);
if (!obsparm[i].addr) {
printk("%s: falsely claims to have parameter %s\n",
name, obsparm[i].name);
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:32    [W:0.024 / U:1.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site