[PATCH 11/11] modules: do not try to add sysfs attributes if !CONFIG_SYSFS

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>
Cc: Kay Sievers <kay.sievers@...>, Alexey Dobriyan <adobriyan@...>, Greg Kroah-Hartman <gregkh@...>
Date: Thursday, February 21, 2008 - 7:48 pm

From: Kay Sievers <kay.sievers@vrfy.org>

Thanks to Alexey for the testing and the fix of the fix.

Cc: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 kernel/module.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index 92595ba..901cd6a 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -987,12 +987,11 @@ static unsigned long resolve_symbol(Elf_Shdr *sechdrs,
 	return ret;
 }
 
-
 /*
  * /sys/module/foo/sections stuff
  * J. Corbet <corbet@lwn.net>
  */
-#ifdef CONFIG_KALLSYMS
+#if defined(CONFIG_KALLSYMS) && defined(CONFIG_SYSFS)
 static ssize_t module_sect_show(struct module_attribute *mattr,
 				struct module *mod, char *buf)
 {
@@ -1188,7 +1187,7 @@ static inline void add_notes_attrs(struct module *mod, unsigned int nsect,
 static inline void remove_notes_attrs(struct module *mod)
 {
 }
-#endif /* CONFIG_KALLSYMS */
+#endif
 
 #ifdef CONFIG_SYSFS
 int module_add_modinfo_attrs(struct module *mod)
@@ -1231,9 +1230,7 @@ void module_remove_modinfo_attrs(struct module *mod)
 	}
 	kfree(mod->modinfo_attrs);
 }
-#endif
 
-#ifdef CONFIG_SYSFS
 int mod_sysfs_init(struct module *mod)
 {
 	int err;
-- 
1.5.4

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 11/11] modules: do not try to add sysfs attributes if..., Greg Kroah-Hartman, (Thu Feb 21, 7:48 pm)
[PATCH 10/11] POWERPC: fix typo in pseries/power.c, Greg Kroah-Hartman, (Thu Feb 21, 7:48 pm)
[PATCH 09/11] PM: Remove unbalanced mutex_unlock() from dpm_..., Greg Kroah-Hartman, (Thu Feb 21, 7:48 pm)
[PATCH 08/11] UIO: fix Greg's stupid changes, Greg Kroah-Hartman, (Thu Feb 21, 7:48 pm)
[PATCH 07/11] stable_kernel_rules: fix must already be in ma..., Greg Kroah-Hartman, (Thu Feb 21, 7:48 pm)
[PATCH 06/11] ide: mark "ide=reverse" option as obsolete, Greg Kroah-Hartman, (Thu Feb 21, 7:48 pm)
[PATCH 05/11] Driver core: Fix error handling in bus_add_dri..., Greg Kroah-Hartman, (Thu Feb 21, 7:48 pm)
[PATCH 04/11] driver-core: fix kernel-doc function parameters, Greg Kroah-Hartman, (Thu Feb 21, 7:48 pm)
[PATCH 03/11] cpufreq: fix kobject reference count handling, Greg Kroah-Hartman, (Thu Feb 21, 7:47 pm)
[PATCH 02/11] slabinfo: fall back from /sys/kernel/slab to /..., Greg Kroah-Hartman, (Thu Feb 21, 7:47 pm)
[PATCH 01/11] Fix broken utf-8 encodings in ja_JP translatio..., Greg Kroah-Hartman, (Thu Feb 21, 7:47 pm)