Re: [PATCH 2/8] param: use ops in struct kernel_param, rather than get and set fns directly

From
Rusty Russell <hidden>
Date
2009-10-30 11:13:39
Also in
linux-input, linux-nfs, lkml
Reply to
Takashi Iwai, 2009-10-30
On Fri, 30 Oct 2009 08:48:12 pm Takashi Iwai wrote:
At Fri, 23 Oct 2009 00:51:28 +1030,
Rusty Russell wrote:
quoted
This is more kernel-ish, saves some space, and also allows us to
expand the ops without breaking all the callers who are happy for the
new members to be NULL.

The few places which defined their own param types are changed to the
new scheme.

Since we're touching them anyway, we change get and set to take a
const struct kernel_param (which they were, and will be again).

To reduce churn, module_param_call creates the ops struct so the callers
don't have to change (and casts the functions to reduce warnings).
The modern version which takes an ops struct is called module_param_cb.
This is nice, as it also reduces the size of struct kernel_param, so
each parameter uses less footprint (who cares, though?) :)

But, just wondering whether we still need to export get/set
functions.  They can be called from ops now, so if any, it can be
defined even as an inlinefunction or a macro.
My thought too, so I tried that, but many are still used like so:

	module_param_call(foo, set_foo, param_get_uint, NULL, 0644);

They can all be replaced in time with something like:
	static int param_get_foo(char *buffer, const struct kernel_param *kp)
	{
		return param_ops_uint.get(buffer, kp);
	}

But it'll take a transition period.

Thanks!
Rusty.



thanks,

Takashi
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thread (3 messages) 3 messages, 2 authors, last reply 2009-11-01
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help