[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <d1275d52c12c8e5421948a03d4164d5a286cb9dc.1319679966.git.david.decotigny@google.com>
Date: Wed, 26 Oct 2011 19:22:25 -0700
From: David Decotigny <david.decotigny@...gle.com>
To: linux-kernel@...r.kernel.org
Cc: Rusty Russell <rusty@...tcorp.com.au>,
Randy Dunlap <rdunlap@...otime.net>,
Michal Schmidt <mschmidt@...hat.com>,
Linus Walleij <linus.walleij@...ricsson.com>,
David Decotigny <david.decotigny@...gle.com>
Subject: [PATCH v1 1/3] param: make destroy_params() private
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