public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Miles Bader <miles@gnu.org>
Cc: linux-kernel@vger.kernel.org, torvalds@transmeta.com
Subject: Re: [PATCH] Make `obsolete params' work correctly if MODULE_SYMBOL_PREFIX is non-empty
Date: Wed, 08 Jan 2003 22:56:51 +1100	[thread overview]
Message-ID: <20030110073328.D41A52C310@lists.samba.org> (raw)
In-Reply-To: Your message of "Tue, 07 Jan 2003 15:32:39 +0900." <20030107063239.F1ED73745@mcspd15.ucom.lsi.nec.co.jp>

In message <20030107063239.F1ED73745@mcspd15.ucom.lsi.nec.co.jp> you write:
> Since these are just symbols in the module object, they need symbol name
> munging to find the symbol from the parameter name.

Good point.  Linus, please apply.

> [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.]

Should be fine here.  I removed the spaces between the funcname and
the brackets tho.

Thanks!
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

Name: Make obsolete module parameters work with MODULE_SYMBOL_PREFIX
Author: 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 -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);

  reply	other threads:[~2003-01-10  7:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030110073328.D41A52C310@lists.samba.org \
    --to=rusty@rustcorp.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miles@gnu.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox