From: Rusty Russell <rusty@rustcorp.com.au>
To: Tejun Heo <tj@home-tj.org>
Cc: mochel@osdl.org,
lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC/PATCH] Per-device parameter support (13/16)
Date: Mon, 25 Oct 2004 15:56:13 +1000 [thread overview]
Message-ID: <1098683773.8098.43.camel@localhost.localdomain> (raw)
In-Reply-To: <20041023043138.GN3456@home-tj.org>
On Sat, 2004-10-23 at 13:31 +0900, Tejun Heo wrote:
> dp_13_devparam.diff
>
> This is the 13rd patch of 16 patches for devparam.
>
> This patch adds needed data fields to module and device structures
> and actually implements devparam. This patch doesn't hook devparam
> into the driver model it's done in the next patch.
> +int devparam_unknown_modparam(char *name, char *val, void *arg)
> +{
> + struct module *mod = arg;
> + char **param;
> +
> + param = vector_elem(&mod->param_vec, vector_len(&mod->param_vec),
> + GFP_KERNEL);
> +
> + if (param == NULL) {
> + printk(KERN_ERR
> + "Device params: Insufficient memory for `%s'\n", name);
> + return -ENOMEM;
> + }
> +
> + param[0] = name;
> + param[1] = val;
> +
> + return 0;
> +}
> +
> +void devparam_module_done(struct module *mod)
> +{
> + struct vector *vec = &mod->param_vec;
> + int i;
> +
> + for (i = 0; i < vector_len(vec); i++) {
> + char **param = vector_elem(vec, i, 0);
> + if (param[0])
> + printk(KERN_ERR
> + "Device params: Unknown parameter `%s'\n",
> + param[0]);
> + }
> +
> + vector_destroy(vec);
> +}
That seems a strange place to warn... Is that right?
> +
> + /* Module parameter vector, used by deviceparam */
> + struct vector param_vec;
I don't mind the addition of your vector type, but adding infrastructure
always results in arguments. Can you think of another place which needs
it?
Rusty.
--
A bad analogy is like a leaky screwdriver -- Richard Braakman
next prev parent reply other threads:[~2004-10-25 5:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-23 4:31 [RFC/PATCH] Per-device parameter support (13/16) Tejun Heo
2004-10-25 5:04 ` Rusty Russell
2004-10-25 5:56 ` Rusty Russell [this message]
2004-10-25 8:00 ` Tejun Heo
2004-10-25 6:08 ` Rusty Russell
2004-10-25 8:28 ` Tejun Heo
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=1098683773.8098.43.camel@localhost.localdomain \
--to=rusty@rustcorp.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=mochel@osdl.org \
--cc=tj@home-tj.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.