mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Decotigny <david.decotigny@google.com>
To: Randy Dunlap <rdunlap@xenotime.net>,
	Jason Wessel <jason.wessel@windriver.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	kgdb-bugreport@lists.sourceforge.net
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
	Michal Schmidt <mschmidt@redhat.com>,
	Richard Kennedy <richard@rsk.demon.co.uk>,
	Linus Walleij <linus.walleij@stericsson.com>,
	Dmitry Torokhov <dtor@vmware.com>,
	Kay Sievers <kay.sievers@vrfy.org>,
	Lucas De Marchi <lucas.demarchi@profusion.mobi>,
	Satoru Moriya <satoru.moriya@hds.com>,
	David Decotigny <decot@google.com>,
	David Decotigny <david.decotigny@google.com>
Subject: [PATCH v2 1/3] param: make destroy_params() private
Date: Tue,  1 Nov 2011 16:50:33 -0700	[thread overview]
Message-ID: <515981316066d9d94e3152ef33ec509f0a49f080.1320191327.git.david.decotigny@google.com> (raw)
In-Reply-To: <cover.1320191327.git.david.decotigny@google.com>
In-Reply-To: <cover.1320191327.git.david.decotigny@google.com>

From: David Decotigny <decot@google.com>

This moves params_destroy to module.c, the only place where it is
needed and called.

Tested:
  make defconfig all



Signed-off-by: David Decotigny <david.decotigny@google.com>
---
 include/linux/moduleparam.h |   10 ----------
 kernel/module.c             |    9 +++++++++
 kernel/params.c             |    8 --------
 3 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index fffb10b..77d09f4 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -289,16 +289,6 @@ extern int parse_args(const char *name,
 		      unsigned num,
 		      int (*unknown)(char *param, char *val));
 
-/* Called by module remove. */
-#ifdef CONFIG_SYSFS
-extern void destroy_params(const struct kernel_param *params, unsigned num);
-#else
-static inline void destroy_params(const struct kernel_param *params,
-				  unsigned num)
-{
-}
-#endif /* !CONFIG_SYSFS */
-
 /* All the helper functions */
 /* The macros to do compile-time type checking stolen from Jakub
    Jelinek, who IIRC came up with this idea for the 2.4 module init code. */
diff --git a/kernel/module.c b/kernel/module.c
index 93342d9..529e965 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1723,6 +1723,15 @@ void __weak module_arch_cleanup(struct module *mod)
 {
 }
 
+static void destroy_params(const struct kernel_param *params, unsigned num)
+{
+	unsigned int i;
+
+	for (i = 0; i < num; i++)
+		if (params[i].ops->free)
+			params[i].ops->free(params[i].arg);
+}
+
 /* Free a module, remove from lists, etc. */
 static void free_module(struct module *mod)
 {
diff --git a/kernel/params.c b/kernel/params.c
index 8217889..75fd7bf 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -711,14 +711,6 @@ void module_param_sysfs_remove(struct module *mod)
 }
 #endif
 
-void destroy_params(const struct kernel_param *params, unsigned num)
-{
-	unsigned int i;
-
-	for (i = 0; i < num; i++)
-		if (params[i].ops->free)
-			params[i].ops->free(params[i].arg);
-}
 
 static struct module_kobject * __init locate_module_kobject(const char *name)
 {
-- 
1.7.3.1


  reply	other threads:[~2011-11-01 23:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01 23:50 [PATCH v2 0/3] param: optional /sys/module/*/parameters David Decotigny
2011-11-01 23:50 ` David Decotigny [this message]
2011-11-01 23:50 ` [PATCH v2 2/3] param: simple refactoring David Decotigny
2011-11-01 23:50 ` [PATCH v2 3/3] param: make /sys/module/*/paramaters optional David Decotigny
2011-11-02  0:24   ` Greg KH
2011-11-02 23:02     ` David Decotigny
2011-11-03  1:29       ` Greg KH
2011-11-02 13:30   ` Jason Wessel
2011-11-02 16:24     ` [Kgdb-bugreport] " Tim Bird
2011-11-02 21:51       ` Rusty Russell

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=515981316066d9d94e3152ef33ec509f0a49f080.1320191327.git.david.decotigny@google.com \
    --to=david.decotigny@google.com \
    --cc=decot@google.com \
    --cc=dtor@vmware.com \
    --cc=gregkh@suse.de \
    --cc=jason.wessel@windriver.com \
    --cc=kay.sievers@vrfy.org \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucas.demarchi@profusion.mobi \
    --cc=mschmidt@redhat.com \
    --cc=rdunlap@xenotime.net \
    --cc=richard@rsk.demon.co.uk \
    --cc=rusty@rustcorp.com.au \
    --cc=satoru.moriya@hds.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

all inboxes | Powered by JetHome®