From: Rusty Russell <rusty@rustcorp.com.au>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org, Miles Bader <miles@gnu.org>
Subject: [PATCH] v850 obsolete params fix
Date: Mon, 13 Jan 2003 14:39:26 +1100 [thread overview]
Message-ID: <20030113034530.E9DC22C04D@lists.samba.org> (raw)
Linus, please apply. No variable arrays anywhere.
Rusty.
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;
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);
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
reply other threads:[~2003-01-13 3:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20030113034530.E9DC22C04D@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
Powered by JetHome