ChangeSet 1.1832.55.9, 2004/09/08 21:25:19-07:00, greg@kroah.com

[PATCH] ksyms: don't implement /sys/kernel/hotplug_seqnum if CONFIG_HOTPLUG is not enabled.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 kernel/ksysfs.c |    8 ++++++--
 lib/kobject.c   |    2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)


diff -Nru a/kernel/ksysfs.c b/kernel/ksysfs.c
--- a/kernel/ksysfs.c	2004-10-19 09:23:10 -07:00
+++ b/kernel/ksysfs.c	2004-10-19 09:23:10 -07:00
@@ -22,17 +22,20 @@
 static struct subsys_attribute _name##_attr = \
 	__ATTR(_name, 0644, _name##_show, _name##_store)
 
+#ifdef CONFIG_HOTPLUG
 static ssize_t hotplug_seqnum_show(struct subsystem *subsys, char *page)
 {
 	return sprintf(page, "%llu\n", hotplug_seqnum);
 }
 KERNEL_ATTR_RO(hotplug_seqnum);
-
+#endif
 
 static decl_subsys(kernel, NULL, NULL);
 
 static struct attribute * kernel_attrs[] = {
+#ifdef CONFIG_HOTPLUG
 	&hotplug_seqnum_attr.attr,
+#endif
 	NULL
 };
 
@@ -44,7 +47,8 @@
 {
 	int error = subsystem_register(&kernel_subsys);
 	if (!error)
-		error = sysfs_create_group(&kernel_subsys.kset.kobj, &kernel_attr_group);
+		error = sysfs_create_group(&kernel_subsys.kset.kobj,
+					   &kernel_attr_group);
 
 	return error;
 }
diff -Nru a/lib/kobject.c b/lib/kobject.c
--- a/lib/kobject.c	2004-10-19 09:23:10 -07:00
+++ b/lib/kobject.c	2004-10-19 09:23:10 -07:00
@@ -118,9 +118,9 @@
 	return path;
 }
 
-u64 hotplug_seqnum;
 #ifdef CONFIG_HOTPLUG
 
+u64 hotplug_seqnum;
 #define BUFFER_SIZE	1024	/* should be enough memory for the env */
 #define NUM_ENVP	32	/* number of env pointers */
 static spinlock_t sequence_lock = SPIN_LOCK_UNLOCKED;
