public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]  Make `obsolete params' work correctly if MODULE_SYMBOL_PREFIX is non-empty
@ 2003-01-07  6:32 Miles Bader
  2003-01-08 11:56 ` Rusty Russell
  0 siblings, 1 reply; 13+ messages in thread
From: Miles Bader @ 2003-01-07  6:32 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel

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

[I guess using the stack is bad in general, but parameter names should be
very short, and hey if they're obsolete, it seems pointless to spend
much effort.]

diff -ruN -X../cludes linux-2.5.54-moo.orig/kernel/module.c linux-2.5.54-moo/kernel/module.c
--- linux-2.5.54-moo.orig/kernel/module.c	2003-01-06 10:51:20.000000000 +0900
+++ linux-2.5.54-moo/kernel/module.c	2003-01-07 14:31:53.000000000 +0900
@@ -666,13 +666,18 @@
 		       num, obsparm[i].name, obsparm[i].type);
 
 	for (i = 0; i < num; i++) {
+		char sym_name[strlen (obsparm[i].name) + 2];
+
+		strcpy (sym_name, MODULE_SYMBOL_PREFIX);
+		strcat (sym_name, obsparm[i].name);
+
 		kp[i].name = obsparm[i].name;
 		kp[i].perm = 000;
 		kp[i].set = set_obsolete;
 		kp[i].get = NULL;
 		obsparm[i].addr
 			= (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);

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [PATCH]  Make `obsolete params' work correctly if MODULE_SYMBOL_PREFIX is non-empty
@ 2003-01-09  9:49 Miles Bader
  2003-01-10  8:31 ` Rusty Russell
  0 siblings, 1 reply; 13+ messages in thread
From: Miles Bader @ 2003-01-09  9:49 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel

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

[I guess using the stack is bad in general, but parameter names should be
very short, and hey if they're obsolete, it seems pointless to spend
much effort.]

diff -ruN -X../cludes linux-2.5.55-moo.orig/kernel/module.c linux-2.5.55-moo/kernel/module.c
--- linux-2.5.55-moo.orig/kernel/module.c	2003-01-09 13:44:25.000000000 +0900
+++ linux-2.5.55-moo/kernel/module.c	2003-01-09 14:07:36.000000000 +0900
@@ -685,13 +685,18 @@
 		       num, obsparm[i].name, obsparm[i].type);
 
 	for (i = 0; i < num; i++) {
+		char sym_name[strlen (obsparm[i].name) + 2];
+
+		strcpy (sym_name, MODULE_SYMBOL_PREFIX);
+		strcat (sym_name, obsparm[i].name);
+
 		kp[i].name = obsparm[i].name;
 		kp[i].perm = 000;
 		kp[i].set = set_obsolete;
 		kp[i].get = NULL;
 		obsparm[i].addr
 			= (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);

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2003-01-11 22:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-07  6:32 [PATCH] Make `obsolete params' work correctly if MODULE_SYMBOL_PREFIX is non-empty Miles Bader
2003-01-08 11:56 ` Rusty Russell
2003-01-10  7:39   ` Miles Bader
2003-01-11 14:50     ` Bill Davidsen
2003-01-10  9:52   ` Richard Henderson
2003-01-10 10:20     ` Rusty Russell
2003-01-10 17:03       ` Linus Torvalds
2003-01-11  4:20         ` Rusty Russell
2003-01-11  5:36           ` Linus Torvalds
2003-01-11 13:42             ` Rusty Russell
2003-01-10 10:39   ` Miles Bader
  -- strict thread matches above, loose matches on Subject: below --
2003-01-09  9:49 Miles Bader
2003-01-10  8:31 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox