mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Alan Stern <stern@rowland.harvard.edu>, Greg K-H <greg@kroah.com>,
	Tejun Heo <htejun@gmail.com>,
	Rusty Russell <rusty@rustcorp.com.au>
Subject: [Patch -mm 1/3] RFC: Use module->mkobj even if !CONFIG_SYSFS.
Date: Mon, 16 Apr 2007 19:36:22 +0200	[thread overview]
Message-ID: <20070416193622.2df5d6fd@gondolin.boeblingen.de.ibm.com> (raw)

Make module->mkobj.kobj useful for refcounting, even if sysfs is
not used.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>

---
 include/linux/module.h |   14 +-------------
 kernel/module.c        |    2 --
 kernel/params.c        |   14 +++++---------
 3 files changed, 6 insertions(+), 24 deletions(-)

--- linux-2.6.orig/include/linux/module.h
+++ linux-2.6/include/linux/module.h
@@ -583,7 +583,6 @@ static inline void print_modules(void)
 #endif /* CONFIG_MODULES */
 
 struct device_driver;
-#ifdef CONFIG_SYSFS
 struct module;
 
 extern struct subsystem module_subsys;
@@ -592,23 +591,12 @@ int mod_sysfs_init(struct module *mod);
 int mod_sysfs_setup(struct module *mod,
 			   struct kernel_param *kparam,
 			   unsigned int num_params);
+#ifdef CONFIG_SYSFS
 int module_add_modinfo_attrs(struct module *mod);
 void module_remove_modinfo_attrs(struct module *mod);
 
 #else /* !CONFIG_SYSFS */
 
-static inline int mod_sysfs_init(struct module *mod)
-{
-	return 0;
-}
-
-static inline int mod_sysfs_setup(struct module *mod,
-			   struct kernel_param *kparam,
-			   unsigned int num_params)
-{
-	return 0;
-}
-
 static inline int module_add_modinfo_attrs(struct module *mod)
 {
 	return 0;
--- linux-2.6.orig/kernel/module.c
+++ linux-2.6/kernel/module.c
@@ -1387,7 +1387,6 @@ void module_remove_modinfo_attrs(struct 
 }
 #endif
 
-#ifdef CONFIG_SYSFS
 int mod_sysfs_init(struct module *mod)
 {
 	int err;
@@ -1447,7 +1446,6 @@ out_unreg:
 out:
 	return err;
 }
-#endif
 
 static void mod_kobject_remove(struct module *mod)
 {
--- linux-2.6.orig/kernel/params.c
+++ linux-2.6/kernel/params.c
@@ -621,7 +621,11 @@ static void __init param_sysfs_builtin(v
 		kernel_param_sysfs_setup(modname, kp_begin, count,
 					 strlen(modname)+1);
 }
-
+#else
+static void __init param_sysfs_builtin(void)
+{
+}
+#endif
 
 /* module-related sysfs stuff */
 
@@ -712,14 +716,6 @@ static int __init param_sysfs_init(void)
 }
 subsys_initcall(param_sysfs_init);
 
-#else
-#if 0
-static struct sysfs_ops module_sysfs_ops = {
-	.show = NULL,
-	.store = NULL,
-};
-#endif
-#endif
 
 EXPORT_SYMBOL(param_set_byte);
 EXPORT_SYMBOL(param_get_byte);

                 reply	other threads:[~2007-04-16 17:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20070416193622.2df5d6fd@gondolin.boeblingen.de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=greg@kroah.com \
    --cc=htejun@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=stern@rowland.harvard.edu \
    /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®