[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <515981316066d9d94e3152ef33ec509f0a49f080.1320191327.git.david.decotigny@google.com>
Date: Tue, 1 Nov 2011 16:50:33 -0700
From: David Decotigny <david.decotigny@...gle.com>
To: Randy Dunlap <rdunlap@...otime.net>,
Jason Wessel <jason.wessel@...driver.com>,
Rusty Russell <rusty@...tcorp.com.au>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
kgdb-bugreport@...ts.sourceforge.net
Cc: Greg Kroah-Hartman <gregkh@...e.de>,
Michal Schmidt <mschmidt@...hat.com>,
Richard Kennedy <richard@....demon.co.uk>,
Linus Walleij <linus.walleij@...ricsson.com>,
Dmitry Torokhov <dtor@...are.com>,
Kay Sievers <kay.sievers@...y.org>,
Lucas De Marchi <lucas.demarchi@...fusion.mobi>,
Satoru Moriya <satoru.moriya@....com>,
David Decotigny <decot@...gle.com>,
David Decotigny <david.decotigny@...gle.com>
Subject: [PATCH v2 1/3] param: make destroy_params() private
From: David Decotigny <decot@...gle.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@...gle.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists