* Re: [PATCH 2/8] param: use ops in struct kernel_param, rather than get and set fns directly
[not found] <20091022142337.EC4A85362F@mx1.suse.de>
@ 2009-10-30 10:18 ` Takashi Iwai
[not found] ` <s5hvdhxyyl7.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Takashi Iwai @ 2009-10-30 10:18 UTC (permalink / raw)
To: Rusty Russell
Cc: linux-kernel, David S. Miller, Ville Syrjala, Dmitry Torokhov,
Alessandro Rubini, Michal Januszewski, Trond Myklebust,
J. Bruce Fields, Neil Brown, linux-input, linux-fbdev-devel,
linux-nfs, netdev
At Fri, 23 Oct 2009 00:51:28 +1030,
Rusty Russell wrote:
>
> 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.
thanks,
Takashi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/8] param: use ops in struct kernel_param, rather than get and set fns directly
[not found] ` <s5hvdhxyyl7.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
@ 2009-10-30 11:13 ` Rusty Russell
2009-11-01 10:26 ` Takashi Iwai
0 siblings, 1 reply; 3+ messages in thread
From: Rusty Russell @ 2009-10-30 11:13 UTC (permalink / raw)
To: Takashi Iwai
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, David S. Miller,
Ville Syrjala, Dmitry Torokhov, Alessandro Rubini,
Michal Januszewski, Trond Myklebust, J. Bruce Fields, Neil Brown,
linux-input-u79uwXL29TY76Z2rM5mHXA,
linux-fbdev-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-nfs-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA
On Fri, 30 Oct 2009 08:48:12 pm Takashi Iwai wrote:
> At Fri, 23 Oct 2009 00:51:28 +1030,
> Rusty Russell wrote:
> >
> > 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/8] param: use ops in struct kernel_param, rather than get and set fns directly
2009-10-30 11:13 ` Rusty Russell
@ 2009-11-01 10:26 ` Takashi Iwai
0 siblings, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2009-11-01 10:26 UTC (permalink / raw)
To: Rusty Russell
Cc: linux-kernel, David S. Miller, Ville Syrjala, Dmitry Torokhov,
Alessandro Rubini, Michal Januszewski, Trond Myklebust,
J. Bruce Fields, Neil Brown, linux-input, linux-fbdev-devel,
linux-nfs, netdev
At Fri, 30 Oct 2009 21:43:39 +1030,
Rusty Russell wrote:
>
> On Fri, 30 Oct 2009 08:48:12 pm Takashi Iwai wrote:
> > At Fri, 23 Oct 2009 00:51:28 +1030,
> > Rusty Russell wrote:
> > >
> > > 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.
Fair enough. And, maybe these get/set should be defined as an ops
explicitly so that it can be used for multiple parameters. But we
can do cleanups later, of course :)
Oh, in case you need,
Reviewed-by: Takashi Iwai <tiwai@suse.de>
for all new patches.
Thanks!
Takashi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-11-01 10:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20091022142337.EC4A85362F@mx1.suse.de>
2009-10-30 10:18 ` [PATCH 2/8] param: use ops in struct kernel_param, rather than get and set fns directly Takashi Iwai
[not found] ` <s5hvdhxyyl7.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
2009-10-30 11:13 ` Rusty Russell
2009-11-01 10:26 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).