All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty-8n+1lVoiYb80n/F98K4Iww@public.gmane.org>
To: Takashi Iwai <tiwai-l3A5Bk7waGM@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
	Ville Syrjala <syrjala-ORSVBvAovxo@public.gmane.org>,
	Dmitry Torokhov
	<dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Alessandro Rubini
	<rubini-JCs+bAQazDroPXhRcRtihA@public.gmane.org>,
	Michal Januszewski
	<spock-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>,
	Trond Myklebust
	<Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>,
	"J. Bruce Fields"
	<bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>,
	Neil Brown <neilb-l3A5Bk7waGM@public.gmane.org>,
	linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-fbdev-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/8] param: use ops in struct kernel_param, rather than get and set fns directly
Date: Fri, 30 Oct 2009 21:43:39 +1030	[thread overview]
Message-ID: <200910302143.40268.rusty@rustcorp.com.au> (raw)
In-Reply-To: <s5hvdhxyyl7.wl%tiwai-l3A5Bk7waGM@public.gmane.org>

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

WARNING: multiple messages have this Message-ID (diff)
From: Rusty Russell <rusty@rustcorp.com.au>
To: Takashi Iwai <tiwai@suse.de>
Cc: linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Ville Syrjala <syrjala-ORSVBvAovxo@public.gmane.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Alessandro Rubini
	<rubini-JCs+bAQazDroPXhRcRtihA@public.gmane.org>,
	Michal Januszewski <spock@gentoo.org>,
	Trond Myklebust <Trond.Myklebust@netapp.com>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	Neil Brown <neilb@suse.de>,
	linux-input@vger.kernel.org,
	linux-fbdev-devel@lists.sourceforge.net,
	linux-nfs@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH 2/8] param: use ops in struct kernel_param, rather than get and set fns directly
Date: Fri, 30 Oct 2009 21:43:39 +1030	[thread overview]
Message-ID: <200910302143.40268.rusty@rustcorp.com.au> (raw)
In-Reply-To: <s5hvdhxyyl7.wl%tiwai@suse.de>

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
> 

WARNING: multiple messages have this Message-ID (diff)
From: Rusty Russell <rusty@rustcorp.com.au>
To: Takashi Iwai <tiwai@suse.de>
Cc: linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Ville Syrjala <syrjala@sci.fi>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Alessandro Rubini <rubini@vision.unipv.it>,
	Michal Januszewski <spock@gentoo.org>,
	Trond Myklebust <Trond.Myklebust@netapp.com>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	Neil Brown <neilb@suse.de>,
	linux-input@vger.kernel.org,
	linux-fbdev-devel@lists.sourceforge.net,
	linux-nfs@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH 2/8] param: use ops in struct kernel_param, rather than get and set fns directly
Date: Fri, 30 Oct 2009 21:43:39 +1030	[thread overview]
Message-ID: <200910302143.40268.rusty@rustcorp.com.au> (raw)
In-Reply-To: <s5hvdhxyyl7.wl%tiwai@suse.de>

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
> 

  parent reply	other threads:[~2009-10-30 11:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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
2009-10-30 10:18   ` Takashi Iwai
     [not found]   ` <s5hvdhxyyl7.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
2009-10-30 11:13     ` Rusty Russell [this message]
2009-10-30 11:13       ` Rusty Russell
2009-10-30 11:13       ` Rusty Russell
2009-11-01 10:26       ` Takashi Iwai
2009-11-01 10:26         ` Takashi Iwai
2009-11-16 15:50       ` Takashi Iwai

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=200910302143.40268.rusty@rustcorp.com.au \
    --to=rusty-8n+1lvoiyb80n/f98k4iww@public.gmane.org \
    --cc=Trond.Myklebust-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org \
    --cc=bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-fbdev-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=neilb-l3A5Bk7waGM@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rubini-JCs+bAQazDroPXhRcRtihA@public.gmane.org \
    --cc=spock-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org \
    --cc=syrjala-ORSVBvAovxo@public.gmane.org \
    --cc=tiwai-l3A5Bk7waGM@public.gmane.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.