
This is the bare set of fixes needed to get the memory class stuff to compile.

Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
---

 memhotplug-dave/arch/i386/Kconfig      |    2 +-
 memhotplug-dave/drivers/base/Makefile  |    4 ++--
 memhotplug-dave/drivers/base/init.c    |    1 -
 memhotplug-dave/drivers/base/memory.c  |    8 ++++----
 memhotplug-dave/include/linux/memory.h |    9 +++++++++
 memhotplug-dave/mm/page_alloc.c        |    2 +-
 6 files changed, 17 insertions(+), 9 deletions(-)

diff -puN drivers/base/memory.c~M-sysfs-memory-class-barefix drivers/base/memory.c
--- memhotplug/drivers/base/memory.c~M-sysfs-memory-class-barefix	2004-08-20 11:28:21.000000000 -0700
+++ memhotplug-dave/drivers/base/memory.c	2004-08-20 11:28:21.000000000 -0700
@@ -23,7 +23,7 @@ EXPORT_SYMBOL(memory_sysdev_class);
  */
 static int memory_hotplug_filter(struct kset *kset, struct kobject *kobj)
 {
-	struct kobj_type *ktype = get_ktype(kobj);
+/*	struct kobj_type *ktype = get_ktype(kobj); */
 	printk("Hit %s\n", __func__);
 	return 1;
 }
@@ -31,7 +31,7 @@ static int memory_hotplug_filter(struct 
 static char *memory_hotplug_name(struct kset *kset, struct kobject *kobj)
 {
 	printk("Hit %s\n", __func__);
-	return "-no_name_implemented";
+        return "-no_name_implemented";
 }
 
 static int memory_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
@@ -212,13 +212,13 @@ int add_memory_block(unsigned long node_
 	return 0;
 }
 
-#define update_memdevice(...) 	(1)
+#define update_memdevice(...) 	do {} while(0)
+#define online_section(...) 	do {} while(0)
 
 static ssize_t
 online_store(struct class *class, const char *buf, size_t count)
 {
 	unsigned int section = simple_strtoul(buf, NULL, 10);
-	int i;
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
diff -puN mm/memory_hotplug.c~M-sysfs-memory-class-barefix mm/memory_hotplug.c
diff -puN mm/page_alloc.c~M-sysfs-memory-class-barefix mm/page_alloc.c
--- memhotplug/mm/page_alloc.c~M-sysfs-memory-class-barefix	2004-08-20 11:28:21.000000000 -0700
+++ memhotplug-dave/mm/page_alloc.c	2004-08-20 11:28:21.000000000 -0700
@@ -1658,7 +1658,7 @@ static void __init calculate_zone_totalp
  * up by free_all_bootmem() once the early boot process is
  * done. Non-atomic initialization, single-pass.
  */
-void __init memmap_init_zone(unsigned long size, int nid, unsigned long zone,
+void __devinit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
 		unsigned long start_pfn)
 {
 	struct page *start = pfn_to_page(start_pfn);
diff -puN drivers/base/Makefile~M-sysfs-memory-class-barefix drivers/base/Makefile
--- memhotplug/drivers/base/Makefile~M-sysfs-memory-class-barefix	2004-08-20 11:28:21.000000000 -0700
+++ memhotplug-dave/drivers/base/Makefile	2004-08-20 11:28:21.000000000 -0700
@@ -2,11 +2,11 @@
 
 obj-y			:= core.o sys.o interface.o bus.o \
 			   driver.o class.o class_simple.o platform.o \
-			   cpu.o firmware.o init.o map.o dmapool.o \
-			   memory.o
+			   cpu.o firmware.o init.o map.o dmapool.o
 obj-y			+= power/
 obj-$(CONFIG_FW_LOADER)	+= firmware_class.o
 obj-$(CONFIG_NUMA)	+= node.o
+obj-$(CONFIG_MEMORY_HOTPLUG) += memory.o
 
 ifeq ($(CONFIG_DEBUG_DRIVER),y)
 EXTRA_CFLAGS += -DDEBUG
diff -puN drivers/base/init.c~M-sysfs-memory-class-barefix drivers/base/init.c
--- memhotplug/drivers/base/init.c~M-sysfs-memory-class-barefix	2004-08-20 11:28:21.000000000 -0700
+++ memhotplug-dave/drivers/base/init.c	2004-08-20 11:28:21.000000000 -0700
@@ -18,7 +18,6 @@ extern int firmware_init(void);
 extern int platform_bus_init(void);
 extern int system_bus_init(void);
 extern int cpu_dev_init(void);
-extern int memory_dev_init(void);
 
 /**
  *	driver_init - initialize driver model.
diff -puN include/linux/memory.h~M-sysfs-memory-class-barefix include/linux/memory.h
--- memhotplug/include/linux/memory.h~M-sysfs-memory-class-barefix	2004-08-20 11:28:21.000000000 -0700
+++ memhotplug-dave/include/linux/memory.h	2004-08-20 11:28:21.000000000 -0700
@@ -23,6 +23,15 @@
 
 #include <asm/semaphore.h>
 
+#ifndef CONFIG_HOTPLUG_MEMORY
+static inline int memory_dev_init(void)
+{
+	return 0;
+}
+#else
+extern int memory_dev_init(void);
+#endif
+
 #ifndef CONFIG_NONLINEAR
 #define CONFIG_MEM_BLOCK_SIZE	(1<<27)
 #else /* tie this to nonlinear */
diff -puN arch/i386/Kconfig~M-sysfs-memory-class-barefix arch/i386/Kconfig
--- memhotplug/arch/i386/Kconfig~M-sysfs-memory-class-barefix	2004-08-20 11:28:21.000000000 -0700
+++ memhotplug-dave/arch/i386/Kconfig	2004-08-20 11:28:21.000000000 -0700
@@ -758,7 +758,7 @@ config ARCH_HAS_MEM_MAP
 
 config MEMORY_HOTPLUG
 	bool "Allow for memory hotplug"
-	depends on NONLINEAR
+	depends on NONLINEAR && HOTPLUG
 
 config HIGHPTE
 	bool "Allocate 3rd-level pagetables from highmem"
_
