## Automatically generated incremental diff
## From:   linux-2.4.2-pre2
## To:     linux-2.4.2-pre3
## Robot:  $Id: make-incremental-diff,v 1.8 2001/12/04 06:05:04 hpa Exp $

diff -urN linux-2.4.2-pre2/Makefile linux/Makefile
--- linux-2.4.2-pre2/Makefile	Mon Dec  3 22:28:12 2001
+++ linux/Makefile	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 2
-EXTRAVERSION =-pre2
+EXTRAVERSION =-pre3
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
diff -urN linux-2.4.2-pre2/arch/alpha/kernel/Makefile linux/arch/alpha/kernel/Makefile
--- linux-2.4.2-pre2/arch/alpha/kernel/Makefile	Wed Jan 24 15:16:23 2001
+++ linux/arch/alpha/kernel/Makefile	Mon Dec  3 22:28:20 2001
@@ -30,9 +30,7 @@
 obj-y	 += console.o
 endif
 
-
 obj-$(CONFIG_SMP)    += smp.o irq_smp.o
-
 obj-$(CONFIG_PCI)    += pci.o pci_iommu.o
 
 ifdef CONFIG_ALPHA_GENERIC
@@ -76,7 +74,7 @@
 endif
 
 obj-$(CONFIG_ALPHA_EIGER) += sys_eiger.o
-obj-$(CONFIG_ALPHA_JENSEN) += sys_jensen.o
+obj-$(CONFIG_ALPHA_JENSEN) += sys_jensen.o pci-noop.o
 obj-$(CONFIG_ALPHA_MIATA) += sys_miata.o
 obj-$(CONFIG_ALPHA_MIKASA) += sys_mikasa.o
 obj-$(CONFIG_ALPHA_NAUTILUS) += sys_nautilus.o
diff -urN linux-2.4.2-pre2/arch/alpha/kernel/alpha_ksyms.c linux/arch/alpha/kernel/alpha_ksyms.c
--- linux-2.4.2-pre2/arch/alpha/kernel/alpha_ksyms.c	Mon Dec  3 22:28:12 2001
+++ linux/arch/alpha/kernel/alpha_ksyms.c	Mon Dec  3 22:28:20 2001
@@ -103,6 +103,8 @@
 
 EXPORT_SYMBOL(__direct_map_base);
 EXPORT_SYMBOL(__direct_map_size);
+
+#ifdef CONFIG_PCI
 EXPORT_SYMBOL(pci_alloc_consistent);
 EXPORT_SYMBOL(pci_free_consistent);
 EXPORT_SYMBOL(pci_map_single);
@@ -110,6 +112,7 @@
 EXPORT_SYMBOL(pci_map_sg);
 EXPORT_SYMBOL(pci_unmap_sg);
 EXPORT_SYMBOL(pci_dma_supported);
+#endif
 
 EXPORT_SYMBOL(dump_thread);
 EXPORT_SYMBOL(dump_fpu);
diff -urN linux-2.4.2-pre2/arch/alpha/kernel/irq.c linux/arch/alpha/kernel/irq.c
--- linux-2.4.2-pre2/arch/alpha/kernel/irq.c	Fri Nov 17 08:47:05 2000
+++ linux/arch/alpha/kernel/irq.c	Mon Dec  3 22:28:20 2001
@@ -18,7 +18,7 @@
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/init.h>
 #include <linux/irq.h>
diff -urN linux-2.4.2-pre2/arch/alpha/kernel/osf_sys.c linux/arch/alpha/kernel/osf_sys.c
--- linux-2.4.2-pre2/arch/alpha/kernel/osf_sys.c	Mon Dec  3 22:28:12 2001
+++ linux/arch/alpha/kernel/osf_sys.c	Mon Dec  3 22:28:20 2001
@@ -19,7 +19,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/utsname.h>
diff -urN linux-2.4.2-pre2/arch/alpha/kernel/pci-noop.c linux/arch/alpha/kernel/pci-noop.c
--- linux-2.4.2-pre2/arch/alpha/kernel/pci-noop.c	Wed Dec 31 16:00:00 1969
+++ linux/arch/alpha/kernel/pci-noop.c	Mon Dec  3 22:28:20 2001
@@ -0,0 +1,104 @@
+/*
+ *	linux/arch/alpha/kernel/pci-noop.c
+ *
+ * Stub PCI interfaces for Jensen-specific kernels.
+ */
+
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/bootmem.h>
+#include <linux/errno.h>
+#include <linux/sched.h>
+
+#include "proto.h"
+
+
+/*
+ * The PCI controler list.
+ */
+
+struct pci_controler *hose_head, **hose_tail = &hose_head;
+struct pci_controler *pci_isa_hose;
+
+
+struct pci_controler * __init
+alloc_pci_controler(void)
+{
+	struct pci_controler *hose;
+
+	hose = alloc_bootmem(sizeof(*hose));
+
+	*hose_tail = hose;
+	hose_tail = &hose->next;
+
+	return hose;
+}
+
+struct resource * __init
+alloc_resource(void)
+{
+	struct resource *res;
+
+	res = alloc_bootmem(sizeof(*res));
+
+	return res;
+}
+
+asmlinkage long
+sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn)
+{
+	struct pci_controler *hose;
+	struct pci_dev *dev;
+
+	/* from hose or from bus.devfn */
+	if (which & IOBASE_FROM_HOSE) {
+		for (hose = hose_head; hose; hose = hose->next) 
+			if (hose->index == bus)
+				break;
+		if (!hose)
+			return -ENODEV;
+	} else {
+		/* Special hook for ISA access.  */
+		if (bus == 0 && dfn == 0)
+			hose = pci_isa_hose;
+		else
+			return -ENODEV;
+	}
+
+	switch (which & ~IOBASE_FROM_HOSE) {
+	case IOBASE_HOSE:
+		return hose->index;
+	case IOBASE_SPARSE_MEM:
+		return hose->sparse_mem_base;
+	case IOBASE_DENSE_MEM:
+		return hose->dense_mem_base;
+	case IOBASE_SPARSE_IO:
+		return hose->sparse_io_base;
+	case IOBASE_DENSE_IO:
+		return hose->dense_io_base;
+	case IOBASE_ROOT_BUS:
+		return hose->bus->number;
+	}
+
+	return -EOPNOTSUPP;
+}
+
+asmlinkage long
+sys_pciconfig_read(unsigned long bus, unsigned long dfn,
+		   unsigned long off, unsigned long len, void *buf)
+{
+	if (!capable(CAP_SYS_ADMIN))
+		return -EPERM;
+	else
+		return -ENODEV;
+}
+
+asmlinkage long
+sys_pciconfig_write(unsigned long bus, unsigned long dfn,
+		    unsigned long off, unsigned long len, void *buf)
+{
+	if (!capable(CAP_SYS_ADMIN))
+		return -EPERM;
+	else
+		return -ENODEV;
+}
diff -urN linux-2.4.2-pre2/arch/alpha/kernel/process.c linux/arch/alpha/kernel/process.c
--- linux-2.4.2-pre2/arch/alpha/kernel/process.c	Mon Dec  3 22:28:12 2001
+++ linux/arch/alpha/kernel/process.c	Mon Dec  3 22:28:20 2001
@@ -18,7 +18,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/utsname.h>
diff -urN linux-2.4.2-pre2/arch/alpha/kernel/ptrace.c linux/arch/alpha/kernel/ptrace.c
--- linux-2.4.2-pre2/arch/alpha/kernel/ptrace.c	Mon Jun 19 17:59:32 2000
+++ linux/arch/alpha/kernel/ptrace.c	Mon Dec  3 22:28:20 2001
@@ -12,7 +12,7 @@
 #include <linux/errno.h>
 #include <linux/ptrace.h>
 #include <linux/user.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
diff -urN linux-2.4.2-pre2/arch/alpha/kernel/setup.c linux/arch/alpha/kernel/setup.c
--- linux-2.4.2-pre2/arch/alpha/kernel/setup.c	Tue Jan  2 16:45:37 2001
+++ linux/arch/alpha/kernel/setup.c	Mon Dec  3 22:28:20 2001
@@ -16,7 +16,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/tty.h>
diff -urN linux-2.4.2-pre2/arch/alpha/kernel/smc37c669.c linux/arch/alpha/kernel/smc37c669.c
--- linux-2.4.2-pre2/arch/alpha/kernel/smc37c669.c	Mon Jun 19 17:59:32 2000
+++ linux/arch/alpha/kernel/smc37c669.c	Mon Dec  3 22:28:20 2001
@@ -3,7 +3,7 @@
  */
 #include <linux/kernel.h>
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/delay.h>
diff -urN linux-2.4.2-pre2/arch/alpha/kernel/smc37c93x.c linux/arch/alpha/kernel/smc37c93x.c
--- linux-2.4.2-pre2/arch/alpha/kernel/smc37c93x.c	Sat Nov 27 15:42:54 1999
+++ linux/arch/alpha/kernel/smc37c93x.c	Mon Dec  3 22:28:20 2001
@@ -5,7 +5,7 @@
 #include <linux/config.h>
 #include <linux/kernel.h>
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/delay.h>
diff -urN linux-2.4.2-pre2/arch/arm/config.in linux/arch/arm/config.in
--- linux-2.4.2-pre2/arch/arm/config.in	Mon Dec  3 22:28:12 2001
+++ linux/arch/arm/config.in	Thu Nov 16 12:51:28 2000
@@ -352,7 +352,7 @@
 
 source drivers/ieee1394/Config.in
 
-source drivers/message/i2o/Config.in
+source drivers/i2o/Config.in
 
 mainmenu_option next_comment
 comment 'ISDN subsystem'
diff -urN linux-2.4.2-pre2/arch/arm/kernel/dma-rpc.c linux/arch/arm/kernel/dma-rpc.c
--- linux-2.4.2-pre2/arch/arm/kernel/dma-rpc.c	Mon Dec  3 22:28:12 2001
+++ linux/arch/arm/kernel/dma-rpc.c	Mon Dec  3 22:28:20 2001
@@ -10,7 +10,7 @@
  *  DMA functions specific to RiscPC architecture
  */
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mman.h>
 #include <linux/init.h>
 #include <linux/pci.h>
diff -urN linux-2.4.2-pre2/arch/arm/kernel/dma.c linux/arch/arm/kernel/dma.c
--- linux-2.4.2-pre2/arch/arm/kernel/dma.c	Mon Sep 18 15:15:24 2000
+++ linux/arch/arm/kernel/dma.c	Mon Dec  3 22:28:20 2001
@@ -12,7 +12,7 @@
  *  DMA facilities.
  */
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/mman.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/arch/arm/kernel/ecard.c linux/arch/arm/kernel/ecard.c
--- linux-2.4.2-pre2/arch/arm/kernel/ecard.c	Mon Sep 18 15:15:24 2000
+++ linux/arch/arm/kernel/ecard.c	Mon Dec  3 22:28:20 2001
@@ -35,7 +35,7 @@
 #include <linux/sched.h>
 #include <linux/interrupt.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/proc_fs.h>
 #include <linux/init.h>
 
diff -urN linux-2.4.2-pre2/arch/arm/kernel/irq.c linux/arch/arm/kernel/irq.c
--- linux-2.4.2-pre2/arch/arm/kernel/irq.c	Mon Sep 18 15:15:25 2000
+++ linux/arch/arm/kernel/irq.c	Mon Dec  3 22:28:20 2001
@@ -24,7 +24,7 @@
 #include <linux/sched.h>
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/smp.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/arch/arm/kernel/process.c linux/arch/arm/kernel/process.c
--- linux-2.4.2-pre2/arch/arm/kernel/process.c	Mon Dec  3 22:28:12 2001
+++ linux/arch/arm/kernel/process.c	Mon Dec  3 22:28:20 2001
@@ -17,7 +17,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/delay.h>
 #include <linux/reboot.h>
diff -urN linux-2.4.2-pre2/arch/arm/kernel/sys_arm.c linux/arch/arm/kernel/sys_arm.c
--- linux-2.4.2-pre2/arch/arm/kernel/sys_arm.c	Mon Sep 18 15:15:25 2000
+++ linux/arch/arm/kernel/sys_arm.c	Mon Dec  3 22:28:20 2001
@@ -14,7 +14,7 @@
  */
 #include <linux/errno.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/sem.h>
 #include <linux/msg.h>
diff -urN linux-2.4.2-pre2/arch/i386/defconfig linux/arch/i386/defconfig
--- linux-2.4.2-pre2/arch/i386/defconfig	Mon Jan 29 23:22:01 2001
+++ linux/arch/i386/defconfig	Mon Dec  3 22:28:20 2001
@@ -162,6 +162,11 @@
 # CONFIG_BRIDGE is not set
 
 #
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
 # Telephony Support
 #
 # CONFIG_PHONE is not set
@@ -628,6 +633,7 @@
 CONFIG_SOUND_ES1371=y
 # CONFIG_SOUND_ESSSOLO1 is not set
 # CONFIG_SOUND_MAESTRO is not set
+# CONFIG_SOUND_MAESTRO3 is not set
 # CONFIG_SOUND_SONICVIBES is not set
 # CONFIG_SOUND_TRIDENT is not set
 # CONFIG_SOUND_MSNDCLAS is not set
diff -urN linux-2.4.2-pre2/arch/i386/kernel/apm.c linux/arch/i386/kernel/apm.c
--- linux-2.4.2-pre2/arch/i386/kernel/apm.c	Wed Dec  6 21:00:12 2000
+++ linux/arch/i386/kernel/apm.c	Mon Dec  3 22:28:20 2001
@@ -176,7 +176,7 @@
 #include <linux/stddef.h>
 #include <linux/timer.h>
 #include <linux/fcntl.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/stat.h>
 #include <linux/proc_fs.h>
 #include <linux/miscdevice.h>
diff -urN linux-2.4.2-pre2/arch/i386/kernel/i8259.c linux/arch/i386/kernel/i8259.c
--- linux-2.4.2-pre2/arch/i386/kernel/i8259.c	Sat Nov 18 20:54:39 2000
+++ linux/arch/i386/kernel/i8259.c	Mon Dec  3 22:28:20 2001
@@ -6,7 +6,7 @@
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
 #include <linux/timex.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/smp_lock.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/arch/i386/kernel/io_apic.c linux/arch/i386/kernel/io_apic.c
--- linux-2.4.2-pre2/arch/i386/kernel/io_apic.c	Sun Jan 21 15:41:47 2001
+++ linux/arch/i386/kernel/io_apic.c	Mon Dec  3 22:28:20 2001
@@ -1509,15 +1509,16 @@
  * - IRQ2 is the cascade IRQ, and cannot be a io-apic IRQ.
  *   Linux doesn't really care, as it's not actually used
  *   for any interrupt handling anyway.
- * - IRQ13 is the FPU error IRQ, and may be connected
- *   directly from the FPU to the old PIC. Linux doesn't
- *   really care, because Linux doesn't want to use IRQ13
- *   anyway (exception 16 is the proper FPU error signal)
+ * - There used to be IRQ13 here as well, but all
+ *   MPS-compliant must not use it for FPU coupling and we
+ *   want to use exception 16 anyway.  And there are
+ *   systems who connect it to an I/O APIC for other uses.
+ *   Thus we don't mark it special any longer.
  *
  * Additionally, something is definitely wrong with irq9
  * on PIIX4 boards.
  */
-#define PIC_IRQS	((1<<2)|(1<<13))
+#define PIC_IRQS	(1<<2)
 
 void __init setup_IO_APIC(void)
 {
diff -urN linux-2.4.2-pre2/arch/i386/kernel/irq.c linux/arch/i386/kernel/irq.c
--- linux-2.4.2-pre2/arch/i386/kernel/irq.c	Sun Dec  3 17:48:19 2000
+++ linux/arch/i386/kernel/irq.c	Mon Dec  3 22:28:20 2001
@@ -25,7 +25,7 @@
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
 #include <linux/timex.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/smp_lock.h>
 #include <linux/init.h>
@@ -312,6 +312,7 @@
 		/* Uhhuh.. Somebody else got it. Wait.. */
 		do {
 			do {
+				rep_nop();
 			} while (test_bit(0,&global_irq_lock));
 		} while (test_and_set_bit(0,&global_irq_lock));		
 	}
diff -urN linux-2.4.2-pre2/arch/i386/kernel/microcode.c linux/arch/i386/kernel/microcode.c
--- linux-2.4.2-pre2/arch/i386/kernel/microcode.c	Mon Dec 11 13:42:08 2000
+++ linux/arch/i386/kernel/microcode.c	Mon Dec  3 22:28:20 2001
@@ -52,7 +52,7 @@
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/miscdevice.h>
 #include <linux/devfs_fs_kernel.h>
diff -urN linux-2.4.2-pre2/arch/i386/kernel/mtrr.c linux/arch/i386/kernel/mtrr.c
--- linux-2.4.2-pre2/arch/i386/kernel/mtrr.c	Tue Nov 28 22:34:01 2000
+++ linux/arch/i386/kernel/mtrr.c	Mon Dec  3 22:28:20 2001
@@ -241,7 +241,7 @@
 #include <linux/kernel.h>
 #include <linux/wait.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
 #include <linux/fs.h>
diff -urN linux-2.4.2-pre2/arch/i386/kernel/pci-irq.c linux/arch/i386/kernel/pci-irq.c
--- linux-2.4.2-pre2/arch/i386/kernel/pci-irq.c	Mon Jan 29 12:10:04 2001
+++ linux/arch/i386/kernel/pci-irq.c	Mon Dec  3 22:28:20 2001
@@ -9,7 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 
diff -urN linux-2.4.2-pre2/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c
--- linux-2.4.2-pre2/arch/i386/kernel/process.c	Thu Jan  4 12:50:17 2001
+++ linux/arch/i386/kernel/process.c	Mon Dec  3 22:28:20 2001
@@ -23,7 +23,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
diff -urN linux-2.4.2-pre2/arch/i386/kernel/setup.c linux/arch/i386/kernel/setup.c
--- linux-2.4.2-pre2/arch/i386/kernel/setup.c	Sun Jan 28 19:01:13 2001
+++ linux/arch/i386/kernel/setup.c	Mon Dec  3 22:28:20 2001
@@ -71,7 +71,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/tty.h>
diff -urN linux-2.4.2-pre2/arch/i386/kernel/smpboot.c linux/arch/i386/kernel/smpboot.c
--- linux-2.4.2-pre2/arch/i386/kernel/smpboot.c	Sun Dec 31 10:26:18 2000
+++ linux/arch/i386/kernel/smpboot.c	Mon Dec  3 22:28:20 2001
@@ -389,6 +389,7 @@
 		 */
 		if (test_bit(cpuid, &cpu_callout_map))
 			break;
+		rep_nop();
 	}
 
 	if (!time_before(jiffies, timeout)) {
diff -urN linux-2.4.2-pre2/arch/i386/kernel/traps.c linux/arch/i386/kernel/traps.c
--- linux-2.4.2-pre2/arch/i386/kernel/traps.c	Mon Jan 15 16:54:20 2001
+++ linux/arch/i386/kernel/traps.c	Mon Dec  3 22:28:20 2001
@@ -127,6 +127,11 @@
 	printk("\n");
 }
 
+void show_trace_task(struct task_struct *tsk)
+{
+	show_trace(tsk->thread.esp);
+}
+
 void show_stack(unsigned long * esp)
 {
 	unsigned long *stack;
diff -urN linux-2.4.2-pre2/arch/i386/kernel/visws_apic.c linux/arch/i386/kernel/visws_apic.c
--- linux-2.4.2-pre2/arch/i386/kernel/visws_apic.c	Thu Jul 13 09:29:34 2000
+++ linux/arch/i386/kernel/visws_apic.c	Mon Dec  3 22:28:20 2001
@@ -20,7 +20,7 @@
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
 #include <linux/timex.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.4.2-pre2/arch/ia64/ia32/sys_ia32.c linux/arch/ia64/ia32/sys_ia32.c
--- linux-2.4.2-pre2/arch/ia64/ia32/sys_ia32.c	Wed Jan 24 15:22:26 2001
+++ linux/arch/ia64/ia32/sys_ia32.c	Mon Dec  3 22:28:20 2001
@@ -31,7 +31,7 @@
 #include <linux/msg.h>
 #include <linux/mm.h>
 #include <linux/shm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/uio.h>
 #include <linux/nfs_fs.h>
 #include <linux/smb_fs.h>
diff -urN linux-2.4.2-pre2/arch/ia64/kernel/irq.c linux/arch/ia64/kernel/irq.c
--- linux-2.4.2-pre2/arch/ia64/kernel/irq.c	Thu Jan  4 12:50:17 2001
+++ linux/arch/ia64/kernel/irq.c	Mon Dec  3 22:28:20 2001
@@ -25,7 +25,7 @@
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
 #include <linux/timex.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/smp_lock.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/arch/ia64/kernel/irq_ia64.c linux/arch/ia64/kernel/irq_ia64.c
--- linux-2.4.2-pre2/arch/ia64/kernel/irq_ia64.c	Thu Jan  4 12:50:17 2001
+++ linux/arch/ia64/kernel/irq_ia64.c	Mon Dec  3 22:28:20 2001
@@ -20,7 +20,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/kernel_stat.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ptrace.h>
 #include <linux/random.h>	/* for rand_initialize_irq() */
 #include <linux/signal.h>
diff -urN linux-2.4.2-pre2/arch/ia64/kernel/pci.c linux/arch/ia64/kernel/pci.c
--- linux-2.4.2-pre2/arch/ia64/kernel/pci.c	Thu Jan  4 12:50:17 2001
+++ linux/arch/ia64/kernel/pci.c	Mon Dec  3 22:28:20 2001
@@ -10,7 +10,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/spinlock.h>
 
diff -urN linux-2.4.2-pre2/arch/m68k/atari/hades-pci.c linux/arch/m68k/atari/hades-pci.c
--- linux-2.4.2-pre2/arch/m68k/atari/hades-pci.c	Wed Jan 26 12:44:20 2000
+++ linux/arch/m68k/atari/hades-pci.c	Mon Dec  3 22:28:20 2001
@@ -17,7 +17,7 @@
 
 #if defined(CONFIG_PCI) && defined(CONFIG_HADES)
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/pci.h>
 
diff -urN linux-2.4.2-pre2/arch/m68k/atari/stram.c linux/arch/m68k/atari/stram.c
--- linux-2.4.2-pre2/arch/m68k/atari/stram.c	Mon Nov 27 17:57:34 2000
+++ linux/arch/m68k/atari/stram.c	Mon Dec  3 22:28:20 2001
@@ -16,7 +16,7 @@
 #include <linux/major.h>
 #include <linux/init.h>
 #include <linux/swap.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/pagemap.h>
 #include <linux/shm.h>
diff -urN linux-2.4.2-pre2/arch/m68k/bvme6000/rtc.c linux/arch/m68k/bvme6000/rtc.c
--- linux-2.4.2-pre2/arch/m68k/bvme6000/rtc.c	Wed Jul 12 21:58:42 2000
+++ linux/arch/m68k/bvme6000/rtc.c	Mon Dec  3 22:28:20 2001
@@ -9,7 +9,7 @@
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/fcntl.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/arch/m68k/kernel/bios32.c linux/arch/m68k/kernel/bios32.c
--- linux-2.4.2-pre2/arch/m68k/kernel/bios32.c	Wed Jan 26 12:44:20 2000
+++ linux/arch/m68k/kernel/bios32.c	Mon Dec  3 22:28:20 2001
@@ -26,7 +26,7 @@
  */
 
 #include <linux/pci.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 
 #include <asm/io.h>
diff -urN linux-2.4.2-pre2/arch/m68k/kernel/process.c linux/arch/m68k/kernel/process.c
--- linux-2.4.2-pre2/arch/m68k/kernel/process.c	Tue Sep  5 13:50:01 2000
+++ linux/arch/m68k/kernel/process.c	Mon Dec  3 22:28:20 2001
@@ -20,7 +20,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/reboot.h>
diff -urN linux-2.4.2-pre2/arch/m68k/mac/misc.c linux/arch/m68k/mac/misc.c
--- linux-2.4.2-pre2/arch/m68k/mac/misc.c	Mon Sep 11 08:39:48 2000
+++ linux/arch/m68k/mac/misc.c	Mon Dec  3 22:28:20 2001
@@ -10,7 +10,7 @@
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/time.h>
 #include <linux/kd.h>
 #include <linux/mm.h>
diff -urN linux-2.4.2-pre2/arch/m68k/mm/kmap.c linux/arch/m68k/mm/kmap.c
--- linux-2.4.2-pre2/arch/m68k/mm/kmap.c	Wed Jan 26 12:44:20 2000
+++ linux/arch/m68k/mm/kmap.c	Mon Dec  3 22:28:20 2001
@@ -12,7 +12,7 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/types.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 
 #include <asm/setup.h>
diff -urN linux-2.4.2-pre2/arch/m68k/mm/memory.c linux/arch/m68k/mm/memory.c
--- linux-2.4.2-pre2/arch/m68k/mm/memory.c	Mon Aug  7 21:02:27 2000
+++ linux/arch/m68k/mm/memory.c	Mon Dec  3 22:28:20 2001
@@ -9,7 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/types.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/pagemap.h>
 
diff -urN linux-2.4.2-pre2/arch/m68k/mvme16x/rtc.c linux/arch/m68k/mvme16x/rtc.c
--- linux-2.4.2-pre2/arch/m68k/mvme16x/rtc.c	Wed Jul 12 21:58:42 2000
+++ linux/arch/m68k/mvme16x/rtc.c	Mon Dec  3 22:28:20 2001
@@ -9,7 +9,7 @@
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/fcntl.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/arch/mips/baget/irq.c linux/arch/mips/baget/irq.c
--- linux-2.4.2-pre2/arch/mips/baget/irq.c	Fri Aug  4 16:15:37 2000
+++ linux/arch/mips/baget/irq.c	Mon Dec  3 22:28:20 2001
@@ -16,7 +16,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/timex.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/delay.h>
 
diff -urN linux-2.4.2-pre2/arch/mips/baget/vacserial.c linux/arch/mips/baget/vacserial.c
--- linux-2.4.2-pre2/arch/mips/baget/vacserial.c	Thu Oct 12 14:20:48 2000
+++ linux/arch/mips/baget/vacserial.c	Mon Dec  3 22:28:20 2001
@@ -56,7 +56,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 #ifdef CONFIG_SERIAL_CONSOLE
diff -urN linux-2.4.2-pre2/arch/mips/dec/irq.c linux/arch/mips/dec/irq.c
--- linux-2.4.2-pre2/arch/mips/dec/irq.c	Fri Aug  4 16:15:37 2000
+++ linux/arch/mips/dec/irq.c	Mon Dec  3 22:28:20 2001
@@ -15,7 +15,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/timex.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 
 #include <asm/bitops.h>
diff -urN linux-2.4.2-pre2/arch/mips/kernel/irixelf.c linux/arch/mips/kernel/irixelf.c
--- linux-2.4.2-pre2/arch/mips/kernel/irixelf.c	Sun Sep  3 11:49:25 2000
+++ linux/arch/mips/kernel/irixelf.c	Mon Dec  3 22:28:20 2001
@@ -24,7 +24,7 @@
 #include <linux/file.h>
 #include <linux/fcntl.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/shm.h>
 #include <linux/personality.h>
 #include <linux/elfcore.h>
diff -urN linux-2.4.2-pre2/arch/mips/kernel/irq.c linux/arch/mips/kernel/irq.c
--- linux-2.4.2-pre2/arch/mips/kernel/irq.c	Fri Aug  4 16:15:37 2000
+++ linux/arch/mips/kernel/irq.c	Mon Dec  3 22:28:20 2001
@@ -19,7 +19,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/timex.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 
 #include <asm/bitops.h>
diff -urN linux-2.4.2-pre2/arch/mips/kernel/process.c linux/arch/mips/kernel/process.c
--- linux-2.4.2-pre2/arch/mips/kernel/process.c	Tue Sep  5 13:50:02 2000
+++ linux/arch/mips/kernel/process.c	Mon Dec  3 22:28:20 2001
@@ -14,7 +14,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mman.h>
 #include <linux/sys.h>
 #include <linux/user.h>
diff -urN linux-2.4.2-pre2/arch/mips/kernel/setup.c linux/arch/mips/kernel/setup.c
--- linux-2.4.2-pre2/arch/mips/kernel/setup.c	Tue Jul 11 11:14:48 2000
+++ linux/arch/mips/kernel/setup.c	Mon Dec  3 22:28:20 2001
@@ -19,7 +19,7 @@
 #include <linux/string.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/utsname.h>
 #include <linux/a.out.h>
diff -urN linux-2.4.2-pre2/arch/mips/kernel/sysirix.c linux/arch/mips/kernel/sysirix.c
--- linux-2.4.2-pre2/arch/mips/kernel/sysirix.c	Sat Aug 12 19:48:04 2000
+++ linux/arch/mips/kernel/sysirix.c	Mon Dec  3 22:28:20 2001
@@ -10,7 +10,7 @@
 #include <linux/pagemap.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/swap.h>
 #include <linux/errno.h>
 #include <linux/timex.h>
diff -urN linux-2.4.2-pre2/arch/mips/orion/irq.c linux/arch/mips/orion/irq.c
--- linux-2.4.2-pre2/arch/mips/orion/irq.c	Fri Aug  4 16:15:38 2000
+++ linux/arch/mips/orion/irq.c	Mon Dec  3 22:28:20 2001
@@ -12,7 +12,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/timex.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 
 #include <asm/bitops.h>
diff -urN linux-2.4.2-pre2/arch/mips/orion/misc.c linux/arch/mips/orion/misc.c
--- linux-2.4.2-pre2/arch/mips/orion/misc.c	Fri Aug  4 18:31:19 2000
+++ linux/arch/mips/orion/misc.c	Mon Dec  3 22:28:20 2001
@@ -15,7 +15,7 @@
 #include <linux/string.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/utsname.h>
 #include <linux/a.out.h>
diff -urN linux-2.4.2-pre2/arch/mips/orion/setup.c linux/arch/mips/orion/setup.c
--- linux-2.4.2-pre2/arch/mips/orion/setup.c	Fri Aug  4 18:31:19 2000
+++ linux/arch/mips/orion/setup.c	Mon Dec  3 22:28:20 2001
@@ -14,7 +14,7 @@
 #include <linux/string.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/utsname.h>
 #include <linux/a.out.h>
diff -urN linux-2.4.2-pre2/arch/mips/sgi/kernel/indy_int.c linux/arch/mips/sgi/kernel/indy_int.c
--- linux-2.4.2-pre2/arch/mips/sgi/kernel/indy_int.c	Fri Aug  4 16:15:37 2000
+++ linux/arch/mips/sgi/kernel/indy_int.c	Mon Dec  3 22:28:20 2001
@@ -19,7 +19,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/timex.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.4.2-pre2/arch/mips64/kernel/process.c linux/arch/mips64/kernel/process.c
--- linux-2.4.2-pre2/arch/mips64/kernel/process.c	Tue Nov 28 21:42:04 2000
+++ linux/arch/mips64/kernel/process.c	Mon Dec  3 22:28:20 2001
@@ -13,7 +13,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mman.h>
 #include <linux/sys.h>
 #include <linux/user.h>
diff -urN linux-2.4.2-pre2/arch/mips64/kernel/setup.c linux/arch/mips64/kernel/setup.c
--- linux-2.4.2-pre2/arch/mips64/kernel/setup.c	Mon Dec  3 22:28:12 2001
+++ linux/arch/mips64/kernel/setup.c	Mon Dec  3 22:28:20 2001
@@ -18,7 +18,7 @@
 #include <linux/string.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/utsname.h>
 #include <linux/a.out.h>
diff -urN linux-2.4.2-pre2/arch/mips64/sgi-ip22/ip22-int.c linux/arch/mips64/sgi-ip22/ip22-int.c
--- linux-2.4.2-pre2/arch/mips64/sgi-ip22/ip22-int.c	Tue Nov 28 21:42:04 2000
+++ linux/arch/mips64/sgi-ip22/ip22-int.c	Mon Dec  3 22:28:20 2001
@@ -17,7 +17,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/timex.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.4.2-pre2/arch/mips64/sgi-ip27/ip27-irq.c linux/arch/mips64/sgi-ip27/ip27-irq.c
--- linux-2.4.2-pre2/arch/mips64/sgi-ip27/ip27-irq.c	Tue Nov 28 21:42:04 2000
+++ linux/arch/mips64/sgi-ip27/ip27-irq.c	Mon Dec  3 22:28:20 2001
@@ -13,7 +13,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/timex.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/smp_lock.h>
 #include <linux/kernel_stat.h>
diff -urN linux-2.4.2-pre2/arch/parisc/kernel/ccio-dma.c linux/arch/parisc/kernel/ccio-dma.c
--- linux-2.4.2-pre2/arch/parisc/kernel/ccio-dma.c	Wed Dec  6 11:46:39 2000
+++ linux/arch/parisc/kernel/ccio-dma.c	Mon Dec  3 22:28:20 2001
@@ -36,7 +36,7 @@
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/spinlock.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/pci.h>
 
diff -urN linux-2.4.2-pre2/arch/parisc/kernel/iosapic.c linux/arch/parisc/kernel/iosapic.c
--- linux-2.4.2-pre2/arch/parisc/kernel/iosapic.c	Wed Dec  6 11:46:39 2000
+++ linux/arch/parisc/kernel/iosapic.c	Mon Dec  3 22:28:20 2001
@@ -162,7 +162,7 @@
 #include <linux/spinlock.h>
 #include <linux/pci.h>		/* pci cfg accessor functions  */
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/interrupt.h>	/* irqaction */
 #include <linux/irq.h>		/* irq_region support */
diff -urN linux-2.4.2-pre2/arch/parisc/kernel/irq.c linux/arch/parisc/kernel/irq.c
--- linux-2.4.2-pre2/arch/parisc/kernel/irq.c	Wed Dec  6 11:46:39 2000
+++ linux/arch/parisc/kernel/irq.c	Mon Dec  3 22:28:20 2001
@@ -35,7 +35,7 @@
 #include <linux/types.h>
 #include <linux/ioport.h>
 #include <linux/timex.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
diff -urN linux-2.4.2-pre2/arch/parisc/kernel/lba_pci.c linux/arch/parisc/kernel/lba_pci.c
--- linux-2.4.2-pre2/arch/parisc/kernel/lba_pci.c	Wed Dec  6 11:46:39 2000
+++ linux/arch/parisc/kernel/lba_pci.c	Mon Dec  3 22:28:20 2001
@@ -36,7 +36,7 @@
 #include <linux/init.h>		/* for __init and __devinit */
 #include <linux/pci.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/smp_lock.h>
 
 #include <asm/byteorder.h>
diff -urN linux-2.4.2-pre2/arch/parisc/kernel/pci-dma.c linux/arch/parisc/kernel/pci-dma.c
--- linux-2.4.2-pre2/arch/parisc/kernel/pci-dma.c	Tue Dec  5 12:29:39 2000
+++ linux/arch/parisc/kernel/pci-dma.c	Mon Dec  3 22:28:20 2001
@@ -26,7 +26,7 @@
 #include <linux/pci.h>
 #include <linux/init.h>
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/arch/parisc/kernel/process.c linux/arch/parisc/kernel/process.c
--- linux-2.4.2-pre2/arch/parisc/kernel/process.c	Wed Dec  6 11:46:39 2000
+++ linux/arch/parisc/kernel/process.c	Mon Dec  3 22:28:20 2001
@@ -19,7 +19,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/interrupt.h>
 #include <linux/reboot.h>
diff -urN linux-2.4.2-pre2/arch/parisc/kernel/sba_iommu.c linux/arch/parisc/kernel/sba_iommu.c
--- linux-2.4.2-pre2/arch/parisc/kernel/sba_iommu.c	Tue Dec  5 12:29:39 2000
+++ linux/arch/parisc/kernel/sba_iommu.c	Mon Dec  3 22:28:20 2001
@@ -23,7 +23,7 @@
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/spinlock.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 
 #include <linux/mm.h>
diff -urN linux-2.4.2-pre2/arch/parisc/kernel/setup.c linux/arch/parisc/kernel/setup.c
--- linux-2.4.2-pre2/arch/parisc/kernel/setup.c	Wed Dec  6 11:46:39 2000
+++ linux/arch/parisc/kernel/setup.c	Mon Dec  3 22:28:20 2001
@@ -28,7 +28,7 @@
 
 #include <linux/errno.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/ptrace.h>
 #include <linux/sched.h>
diff -urN linux-2.4.2-pre2/arch/parisc/mm/kmap.c linux/arch/parisc/mm/kmap.c
--- linux-2.4.2-pre2/arch/parisc/mm/kmap.c	Tue Dec  5 12:29:39 2000
+++ linux/arch/parisc/mm/kmap.c	Mon Dec  3 22:28:20 2001
@@ -7,7 +7,7 @@
 #include <linux/string.h>
 #include <linux/pci.h>
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/arch/ppc/8260_io/enet.c linux/arch/ppc/8260_io/enet.c
--- linux-2.4.2-pre2/arch/ppc/8260_io/enet.c	Mon Jan 22 15:41:14 2001
+++ linux/arch/ppc/8260_io/enet.c	Mon Dec  3 22:28:20 2001
@@ -30,7 +30,7 @@
 #include <linux/ptrace.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/arch/ppc/8260_io/fcc_enet.c linux/arch/ppc/8260_io/fcc_enet.c
--- linux-2.4.2-pre2/arch/ppc/8260_io/fcc_enet.c	Mon Jan 22 15:41:14 2001
+++ linux/arch/ppc/8260_io/fcc_enet.c	Mon Dec  3 22:28:20 2001
@@ -23,7 +23,7 @@
 #include <linux/ptrace.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/arch/ppc/8260_io/uart.c linux/arch/ppc/8260_io/uart.c
--- linux-2.4.2-pre2/arch/ppc/8260_io/uart.c	Wed Dec  6 12:06:18 2000
+++ linux/arch/ppc/8260_io/uart.c	Mon Dec  3 22:28:20 2001
@@ -38,7 +38,7 @@
 #include <linux/fcntl.h>
 #include <linux/ptrace.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/arch/ppc/8xx_io/enet.c linux/arch/ppc/8xx_io/enet.c
--- linux-2.4.2-pre2/arch/ppc/8xx_io/enet.c	Mon Jan 22 15:41:14 2001
+++ linux/arch/ppc/8xx_io/enet.c	Mon Dec  3 22:28:20 2001
@@ -29,7 +29,7 @@
 #include <linux/ptrace.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/arch/ppc/8xx_io/fec.c linux/arch/ppc/8xx_io/fec.c
--- linux-2.4.2-pre2/arch/ppc/8xx_io/fec.c	Mon Jan 22 15:41:14 2001
+++ linux/arch/ppc/8xx_io/fec.c	Mon Dec  3 22:28:20 2001
@@ -33,7 +33,7 @@
 #include <linux/ptrace.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/arch/ppc/8xx_io/uart.c linux/arch/ppc/8xx_io/uart.c
--- linux-2.4.2-pre2/arch/ppc/8xx_io/uart.c	Wed Dec  6 12:06:18 2000
+++ linux/arch/ppc/8xx_io/uart.c	Mon Dec  3 22:28:20 2001
@@ -34,7 +34,7 @@
 #include <linux/fcntl.h>
 #include <linux/ptrace.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/arch/ppc/kernel/checks.c linux/arch/ppc/kernel/checks.c
--- linux-2.4.2-pre2/arch/ppc/kernel/checks.c	Wed May 26 16:55:40 1999
+++ linux/arch/ppc/kernel/checks.c	Mon Dec  3 22:28:20 2001
@@ -7,7 +7,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
 
diff -urN linux-2.4.2-pre2/arch/ppc/kernel/idle.c linux/arch/ppc/kernel/idle.c
--- linux-2.4.2-pre2/arch/ppc/kernel/idle.c	Mon Jan 22 15:41:15 2001
+++ linux/arch/ppc/kernel/idle.c	Mon Dec  3 22:28:20 2001
@@ -21,7 +21,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/arch/ppc/kernel/irq.c linux/arch/ppc/kernel/irq.c
--- linux-2.4.2-pre2/arch/ppc/kernel/irq.c	Mon Jan 22 15:41:15 2001
+++ linux/arch/ppc/kernel/irq.c	Mon Dec  3 22:28:20 2001
@@ -40,7 +40,7 @@
 #include <linux/timex.h>
 #include <linux/config.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/irq.h>
diff -urN linux-2.4.2-pre2/arch/ppc/kernel/m8260_setup.c linux/arch/ppc/kernel/m8260_setup.c
--- linux-2.4.2-pre2/arch/ppc/kernel/m8260_setup.c	Mon Jan 22 15:41:15 2001
+++ linux/arch/ppc/kernel/m8260_setup.c	Mon Dec  3 22:28:20 2001
@@ -22,7 +22,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/tty.h>
diff -urN linux-2.4.2-pre2/arch/ppc/kernel/m8xx_setup.c linux/arch/ppc/kernel/m8xx_setup.c
--- linux-2.4.2-pre2/arch/ppc/kernel/m8xx_setup.c	Mon Jan 22 15:41:15 2001
+++ linux/arch/ppc/kernel/m8xx_setup.c	Mon Dec  3 22:28:20 2001
@@ -22,7 +22,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/tty.h>
diff -urN linux-2.4.2-pre2/arch/ppc/kernel/pmac_setup.c linux/arch/ppc/kernel/pmac_setup.c
--- linux-2.4.2-pre2/arch/ppc/kernel/pmac_setup.c	Mon Jan 22 15:41:15 2001
+++ linux/arch/ppc/kernel/pmac_setup.c	Mon Dec  3 22:28:20 2001
@@ -30,7 +30,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/tty.h>
diff -urN linux-2.4.2-pre2/arch/ppc/kernel/prep_nvram.c linux/arch/ppc/kernel/prep_nvram.c
--- linux-2.4.2-pre2/arch/ppc/kernel/prep_nvram.c	Mon Jan 22 15:41:15 2001
+++ linux/arch/ppc/kernel/prep_nvram.c	Mon Dec  3 22:28:20 2001
@@ -6,7 +6,7 @@
  */
 #include <linux/init.h>
 #include <linux/delay.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 
 #include <asm/init.h>
diff -urN linux-2.4.2-pre2/arch/ppc/kernel/prep_setup.c linux/arch/ppc/kernel/prep_setup.c
--- linux-2.4.2-pre2/arch/ppc/kernel/prep_setup.c	Mon Jan 22 15:41:15 2001
+++ linux/arch/ppc/kernel/prep_setup.c	Mon Dec  3 22:28:20 2001
@@ -19,7 +19,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/tty.h>
diff -urN linux-2.4.2-pre2/arch/ppc/kernel/process.c linux/arch/ppc/kernel/process.c
--- linux-2.4.2-pre2/arch/ppc/kernel/process.c	Mon Jan 22 15:41:15 2001
+++ linux/arch/ppc/kernel/process.c	Mon Dec  3 22:28:20 2001
@@ -29,7 +29,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/elf.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/arch/ppc/kernel/residual.c linux/arch/ppc/kernel/residual.c
--- linux-2.4.2-pre2/arch/ppc/kernel/residual.c	Tue Oct 12 10:00:58 1999
+++ linux/arch/ppc/kernel/residual.c	Mon Dec  3 22:28:20 2001
@@ -30,7 +30,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/tty.h>
diff -urN linux-2.4.2-pre2/arch/ppc/kernel/softemu8xx.c linux/arch/ppc/kernel/softemu8xx.c
--- linux-2.4.2-pre2/arch/ppc/kernel/softemu8xx.c	Tue Aug 31 11:36:43 1999
+++ linux/arch/ppc/kernel/softemu8xx.c	Mon Dec  3 22:28:20 2001
@@ -21,7 +21,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/arch/ppc/kernel/traps.c linux/arch/ppc/kernel/traps.c
--- linux-2.4.2-pre2/arch/ppc/kernel/traps.c	Mon Jan 22 15:41:15 2001
+++ linux/arch/ppc/kernel/traps.c	Mon Dec  3 22:28:20 2001
@@ -23,7 +23,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/arch/s390/kernel/irq.c linux/arch/s390/kernel/irq.c
--- linux-2.4.2-pre2/arch/s390/kernel/irq.c	Fri Aug  4 16:15:37 2000
+++ linux/arch/s390/kernel/irq.c	Mon Dec  3 22:28:20 2001
@@ -20,7 +20,7 @@
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
 #include <linux/timex.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/random.h>
 #include <linux/smp.h>
diff -urN linux-2.4.2-pre2/arch/s390/kernel/process.c linux/arch/s390/kernel/process.c
--- linux-2.4.2-pre2/arch/s390/kernel/process.c	Tue Sep  5 13:50:01 2000
+++ linux/arch/s390/kernel/process.c	Mon Dec  3 22:28:20 2001
@@ -28,7 +28,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
diff -urN linux-2.4.2-pre2/arch/s390/kernel/s390io.c linux/arch/s390/kernel/s390io.c
--- linux-2.4.2-pre2/arch/s390/kernel/s390io.c	Fri Aug  4 16:15:37 2000
+++ linux/arch/s390/kernel/s390io.c	Mon Dec  3 22:28:20 2001
@@ -14,7 +14,7 @@
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/smp.h>
 #include <linux/tasks.h>
diff -urN linux-2.4.2-pre2/arch/s390/kernel/setup.c linux/arch/s390/kernel/setup.c
--- linux-2.4.2-pre2/arch/s390/kernel/setup.c	Fri May 12 11:41:45 2000
+++ linux/arch/s390/kernel/setup.c	Mon Dec  3 22:28:20 2001
@@ -21,7 +21,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/tty.h>
diff -urN linux-2.4.2-pre2/arch/sh/kernel/irq.c linux/arch/sh/kernel/irq.c
--- linux-2.4.2-pre2/arch/sh/kernel/irq.c	Sun Jan 28 18:56:00 2001
+++ linux/arch/sh/kernel/irq.c	Mon Dec  3 22:28:20 2001
@@ -22,7 +22,7 @@
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
 #include <linux/timex.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.4.2-pre2/arch/sh/kernel/process.c linux/arch/sh/kernel/process.c
--- linux-2.4.2-pre2/arch/sh/kernel/process.c	Sun Jan 28 18:56:00 2001
+++ linux/arch/sh/kernel/process.c	Mon Dec  3 22:28:20 2001
@@ -24,7 +24,7 @@
 #include <linux/smp_lock.h>
 #include <linux/stddef.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
diff -urN linux-2.4.2-pre2/arch/sh/kernel/setup.c linux/arch/sh/kernel/setup.c
--- linux-2.4.2-pre2/arch/sh/kernel/setup.c	Sun Jan 28 18:56:00 2001
+++ linux/arch/sh/kernel/setup.c	Mon Dec  3 22:28:20 2001
@@ -17,7 +17,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/tty.h>
diff -urN linux-2.4.2-pre2/arch/sparc/kernel/ebus.c linux/arch/sparc/kernel/ebus.c
--- linux-2.4.2-pre2/arch/sparc/kernel/ebus.c	Thu Nov  9 15:57:41 2000
+++ linux/arch/sparc/kernel/ebus.c	Mon Dec  3 22:28:20 2001
@@ -11,7 +11,7 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 
 #include <asm/system.h>
diff -urN linux-2.4.2-pre2/arch/sparc/kernel/ioport.c linux/arch/sparc/kernel/ioport.c
--- linux-2.4.2-pre2/arch/sparc/kernel/ioport.c	Mon Dec 11 12:37:02 2000
+++ linux/arch/sparc/kernel/ioport.c	Mon Dec  3 22:28:20 2001
@@ -32,7 +32,7 @@
 #include <linux/types.h>
 #include <linux/ioport.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pci.h>		/* struct pci_dev */
 #include <linux/proc_fs.h>
 
diff -urN linux-2.4.2-pre2/arch/sparc/kernel/irq.c linux/arch/sparc/kernel/irq.c
--- linux-2.4.2-pre2/arch/sparc/kernel/irq.c	Thu Sep  7 08:32:00 2000
+++ linux/arch/sparc/kernel/irq.c	Mon Dec  3 22:28:20 2001
@@ -19,7 +19,7 @@
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/init.h>
 #include <linux/smp.h>
diff -urN linux-2.4.2-pre2/arch/sparc/kernel/pcic.c linux/arch/sparc/kernel/pcic.c
--- linux-2.4.2-pre2/arch/sparc/kernel/pcic.c	Mon Jan 22 13:30:20 2001
+++ linux/arch/sparc/kernel/pcic.c	Mon Dec  3 22:28:20 2001
@@ -15,7 +15,7 @@
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <asm/ebus.h>
 #include <asm/sbus.h> /* for sanity check... */
diff -urN linux-2.4.2-pre2/arch/sparc/kernel/process.c linux/arch/sparc/kernel/process.c
--- linux-2.4.2-pre2/arch/sparc/kernel/process.c	Tue Oct 10 10:33:51 2000
+++ linux/arch/sparc/kernel/process.c	Mon Dec  3 22:28:20 2001
@@ -19,7 +19,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/config.h>
diff -urN linux-2.4.2-pre2/arch/sparc/kernel/setup.c linux/arch/sparc/kernel/setup.c
--- linux-2.4.2-pre2/arch/sparc/kernel/setup.c	Mon Jan  1 10:37:41 2001
+++ linux/arch/sparc/kernel/setup.c	Mon Dec  3 22:28:20 2001
@@ -12,7 +12,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <asm/smp.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
diff -urN linux-2.4.2-pre2/arch/sparc/kernel/sun4c_irq.c linux/arch/sparc/kernel/sun4c_irq.c
--- linux-2.4.2-pre2/arch/sparc/kernel/sun4c_irq.c	Mon May  8 22:00:01 2000
+++ linux/arch/sparc/kernel/sun4c_irq.c	Mon Dec  3 22:28:20 2001
@@ -17,7 +17,7 @@
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 
 #include <asm/ptrace.h>
diff -urN linux-2.4.2-pre2/arch/sparc/kernel/sun4d_irq.c linux/arch/sparc/kernel/sun4d_irq.c
--- linux-2.4.2-pre2/arch/sparc/kernel/sun4d_irq.c	Wed Jul 26 18:36:44 2000
+++ linux/arch/sparc/kernel/sun4d_irq.c	Mon Dec  3 22:28:20 2001
@@ -14,7 +14,7 @@
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/init.h>
 #include <linux/smp.h>
diff -urN linux-2.4.2-pre2/arch/sparc/kernel/sun4d_smp.c linux/arch/sparc/kernel/sun4d_smp.c
--- linux-2.4.2-pre2/arch/sparc/kernel/sun4d_smp.c	Tue Nov 28 21:53:44 2000
+++ linux/arch/sparc/kernel/sun4d_smp.c	Mon Dec  3 22:28:20 2001
@@ -287,11 +287,11 @@
 				smp_highest_cpu = i;
 			}
 		}
-		SMP_PRINTK(("Total of %d Processors activated (%lu.%02lu BogoMIPS).\n", cpucount + 1, (bogosum + 2500)/500000, ((bogosum + 2500)/5000)%100));
+		SMP_PRINTK(("Total of %d Processors activated (%lu.%02lu BogoMIPS).\n", cpucount + 1, bogosum/(500000/HZ), (bogosum/(5000/HZ))%100));
 		printk("Total of %d Processors activated (%lu.%02lu BogoMIPS).\n",
 		       cpucount + 1,
-		       (bogosum + 2500)/500000,
-		       ((bogosum + 2500)/5000)%100);
+		       bogosum/(500000/HZ),
+		       (bogosum/(5000/HZ))%100);
 		smp_activated = 1;
 		smp_num_cpus = cpucount + 1;
 	}
diff -urN linux-2.4.2-pre2/arch/sparc/kernel/sun4m_irq.c linux/arch/sparc/kernel/sun4m_irq.c
--- linux-2.4.2-pre2/arch/sparc/kernel/sun4m_irq.c	Mon May  8 22:00:01 2000
+++ linux/arch/sparc/kernel/sun4m_irq.c	Mon Dec  3 22:28:20 2001
@@ -18,7 +18,7 @@
 #include <linux/sched.h>
 #include <linux/smp.h>
 #include <linux/interrupt.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
 
diff -urN linux-2.4.2-pre2/arch/sparc/kernel/sun4m_smp.c linux/arch/sparc/kernel/sun4m_smp.c
--- linux-2.4.2-pre2/arch/sparc/kernel/sun4m_smp.c	Tue Nov 28 21:53:44 2000
+++ linux/arch/sparc/kernel/sun4m_smp.c	Mon Dec  3 22:28:20 2001
@@ -256,8 +256,8 @@
 		}
 		printk("Total of %d Processors activated (%lu.%02lu BogoMIPS).\n",
 		       cpucount + 1,
-		       (bogosum + 2500)/500000,
-		       ((bogosum + 2500)/5000)%100);
+		       bogosum/(500000/HZ),
+		       (bogosum/(5000/HZ))%100);
 		smp_activated = 1;
 		smp_num_cpus = cpucount + 1;
 	}
diff -urN linux-2.4.2-pre2/arch/sparc/kernel/sys_sunos.c linux/arch/sparc/kernel/sys_sunos.c
--- linux-2.4.2-pre2/arch/sparc/kernel/sys_sunos.c	Wed Jan 24 15:18:06 2001
+++ linux/arch/sparc/kernel/sys_sunos.c	Mon Dec  3 22:28:20 2001
@@ -28,7 +28,7 @@
 #include <linux/utsname.h>
 #include <linux/major.h>
 #include <linux/stat.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pagemap.h>
 #include <linux/errno.h>
 #include <linux/smp.h>
diff -urN linux-2.4.2-pre2/arch/sparc/mm/io-unit.c linux/arch/sparc/mm/io-unit.c
--- linux-2.4.2-pre2/arch/sparc/mm/io-unit.c	Wed Aug  9 13:49:55 2000
+++ linux/arch/sparc/mm/io-unit.c	Mon Dec  3 22:28:20 2001
@@ -7,7 +7,7 @@
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <asm/scatterlist.h>
 #include <asm/pgalloc.h>
diff -urN linux-2.4.2-pre2/arch/sparc/mm/iommu.c linux/arch/sparc/mm/iommu.c
--- linux-2.4.2-pre2/arch/sparc/mm/iommu.c	Wed Aug  9 13:49:55 2000
+++ linux/arch/sparc/mm/iommu.c	Mon Dec  3 22:28:20 2001
@@ -11,7 +11,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <asm/scatterlist.h>
 #include <asm/pgalloc.h>
 #include <asm/pgtable.h>
diff -urN linux-2.4.2-pre2/arch/sparc/mm/srmmu.c linux/arch/sparc/mm/srmmu.c
--- linux-2.4.2-pre2/arch/sparc/mm/srmmu.c	Mon Dec 11 12:37:03 2000
+++ linux/arch/sparc/mm/srmmu.c	Mon Dec  3 22:28:20 2001
@@ -11,7 +11,7 @@
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/pagemap.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/arch/sparc64/kernel/binfmt_aout32.c linux/arch/sparc64/kernel/binfmt_aout32.c
--- linux-2.4.2-pre2/arch/sparc64/kernel/binfmt_aout32.c	Sun Jul  9 22:30:37 2000
+++ linux/arch/sparc64/kernel/binfmt_aout32.c	Mon Dec  3 22:28:20 2001
@@ -23,7 +23,7 @@
 #include <linux/fcntl.h>
 #include <linux/ptrace.h>
 #include <linux/user.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/binfmts.h>
 #include <linux/personality.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/arch/sparc64/kernel/ebus.c linux/arch/sparc64/kernel/ebus.c
--- linux-2.4.2-pre2/arch/sparc64/kernel/ebus.c	Thu Nov  9 15:57:41 2000
+++ linux/arch/sparc64/kernel/ebus.c	Mon Dec  3 22:28:20 2001
@@ -9,7 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 
 #include <asm/system.h>
diff -urN linux-2.4.2-pre2/arch/sparc64/kernel/ioctl32.c linux/arch/sparc64/kernel/ioctl32.c
--- linux-2.4.2-pre2/arch/sparc64/kernel/ioctl32.c	Mon Jan 22 13:30:20 2001
+++ linux/arch/sparc64/kernel/ioctl32.c	Mon Dec  3 22:28:20 2001
@@ -1,4 +1,4 @@
-/* $Id: ioctl32.c,v 1.105 2001/01/18 04:47:44 davem Exp $
+/* $Id: ioctl32.c,v 1.106 2001/01/30 01:04:28 davem Exp $
  * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
  *
  * Copyright (C) 1997-2000  Jakub Jelinek  (jakub@redhat.com)
@@ -16,7 +16,7 @@
 #include <linux/smp_lock.h>
 #include <linux/ioctl.h>
 #include <linux/if.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/hdreg.h>
 #include <linux/raid/md.h>
 #include <linux/kd.h>
@@ -3770,7 +3770,7 @@
 
 unsigned int ioctl32_hash_table[1024];
 
-extern inline unsigned long ioctl32_hash(unsigned long cmd)
+static inline unsigned long ioctl32_hash(unsigned long cmd)
 {
 	return ((cmd >> 6) ^ (cmd >> 4) ^ cmd) & 0x3ff;
 }
diff -urN linux-2.4.2-pre2/arch/sparc64/kernel/irq.c linux/arch/sparc64/kernel/irq.c
--- linux-2.4.2-pre2/arch/sparc64/kernel/irq.c	Tue Oct  3 09:24:41 2000
+++ linux/arch/sparc64/kernel/irq.c	Mon Dec  3 22:28:20 2001
@@ -13,7 +13,7 @@
 #include <linux/signal.h>
 #include <linux/mm.h>
 #include <linux/interrupt.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h> /* XXX ADD add_foo_randomness() calls... -DaveM */
 #include <linux/init.h>
 #include <linux/delay.h>
diff -urN linux-2.4.2-pre2/arch/sparc64/kernel/pci_common.c linux/arch/sparc64/kernel/pci_common.c
--- linux-2.4.2-pre2/arch/sparc64/kernel/pci_common.c	Wed May  3 01:47:57 2000
+++ linux/arch/sparc64/kernel/pci_common.c	Mon Dec  3 22:28:20 2001
@@ -5,7 +5,7 @@
  */
 
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 
 #include <asm/pbm.h>
diff -urN linux-2.4.2-pre2/arch/sparc64/kernel/pci_psycho.c linux/arch/sparc64/kernel/pci_psycho.c
--- linux-2.4.2-pre2/arch/sparc64/kernel/pci_psycho.c	Mon Jan 22 13:30:20 2001
+++ linux/arch/sparc64/kernel/pci_psycho.c	Mon Dec  3 22:28:20 2001
@@ -10,7 +10,7 @@
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <asm/pbm.h>
 #include <asm/iommu.h>
diff -urN linux-2.4.2-pre2/arch/sparc64/kernel/pci_sabre.c linux/arch/sparc64/kernel/pci_sabre.c
--- linux-2.4.2-pre2/arch/sparc64/kernel/pci_sabre.c	Mon Jan 22 13:30:20 2001
+++ linux/arch/sparc64/kernel/pci_sabre.c	Mon Dec  3 22:28:20 2001
@@ -10,7 +10,7 @@
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <asm/apb.h>
 #include <asm/pbm.h>
diff -urN linux-2.4.2-pre2/arch/sparc64/kernel/pci_schizo.c linux/arch/sparc64/kernel/pci_schizo.c
--- linux-2.4.2-pre2/arch/sparc64/kernel/pci_schizo.c	Mon Jan 22 13:30:20 2001
+++ linux/arch/sparc64/kernel/pci_schizo.c	Mon Dec  3 22:28:20 2001
@@ -8,7 +8,7 @@
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <asm/pbm.h>
 #include <asm/iommu.h>
diff -urN linux-2.4.2-pre2/arch/sparc64/kernel/process.c linux/arch/sparc64/kernel/process.c
--- linux-2.4.2-pre2/arch/sparc64/kernel/process.c	Thu Nov  9 15:57:41 2000
+++ linux/arch/sparc64/kernel/process.c	Mon Dec  3 22:28:20 2001
@@ -22,7 +22,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
 #include <linux/config.h>
diff -urN linux-2.4.2-pre2/arch/sparc64/kernel/sbus.c linux/arch/sparc64/kernel/sbus.c
--- linux-2.4.2-pre2/arch/sparc64/kernel/sbus.c	Tue Oct  3 09:24:41 2000
+++ linux/arch/sparc64/kernel/sbus.c	Mon Dec  3 22:28:20 2001
@@ -8,7 +8,7 @@
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/spinlock.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 
 #include <asm/page.h>
diff -urN linux-2.4.2-pre2/arch/sparc64/kernel/setup.c linux/arch/sparc64/kernel/setup.c
--- linux-2.4.2-pre2/arch/sparc64/kernel/setup.c	Mon Jan  1 10:37:41 2001
+++ linux/arch/sparc64/kernel/setup.c	Mon Dec  3 22:28:20 2001
@@ -12,7 +12,7 @@
 #include <linux/stddef.h>
 #include <linux/unistd.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <asm/smp.h>
 #include <linux/user.h>
 #include <linux/a.out.h>
diff -urN linux-2.4.2-pre2/arch/sparc64/kernel/starfire.c linux/arch/sparc64/kernel/starfire.c
--- linux-2.4.2-pre2/arch/sparc64/kernel/starfire.c	Mon Oct 30 14:34:12 2000
+++ linux/arch/sparc64/kernel/starfire.c	Mon Dec  3 22:28:20 2001
@@ -6,7 +6,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <asm/page.h>
 #include <asm/oplib.h>
diff -urN linux-2.4.2-pre2/arch/sparc64/kernel/sys_sparc.c linux/arch/sparc64/kernel/sys_sparc.c
--- linux-2.4.2-pre2/arch/sparc64/kernel/sys_sparc.c	Mon Dec 11 12:37:03 2000
+++ linux/arch/sparc64/kernel/sys_sparc.c	Mon Dec  3 22:28:20 2001
@@ -21,7 +21,7 @@
 #include <linux/utsname.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ipc.h>
 #include <linux/personality.h>
 
diff -urN linux-2.4.2-pre2/arch/sparc64/kernel/sys_sparc32.c linux/arch/sparc64/kernel/sys_sparc32.c
--- linux-2.4.2-pre2/arch/sparc64/kernel/sys_sparc32.c	Wed Jan 24 15:18:06 2001
+++ linux/arch/sparc64/kernel/sys_sparc32.c	Mon Dec  3 22:28:20 2001
@@ -25,7 +25,7 @@
 #include <linux/sem.h>
 #include <linux/msg.h>
 #include <linux/shm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/uio.h>
 #include <linux/nfs_fs.h>
 #include <linux/smb_fs.h>
diff -urN linux-2.4.2-pre2/arch/sparc64/kernel/sys_sunos32.c linux/arch/sparc64/kernel/sys_sunos32.c
--- linux-2.4.2-pre2/arch/sparc64/kernel/sys_sunos32.c	Mon Jan 22 13:30:20 2001
+++ linux/arch/sparc64/kernel/sys_sunos32.c	Mon Dec  3 22:28:20 2001
@@ -27,7 +27,7 @@
 #include <linux/utsname.h>
 #include <linux/major.h>
 #include <linux/stat.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pagemap.h>
 #include <linux/errno.h>
 #include <linux/smp.h>
diff -urN linux-2.4.2-pre2/arch/sparc64/kernel/traps.c linux/arch/sparc64/kernel/traps.c
--- linux-2.4.2-pre2/arch/sparc64/kernel/traps.c	Tue Nov 28 21:53:44 2000
+++ linux/arch/sparc64/kernel/traps.c	Mon Dec  3 22:28:20 2001
@@ -1,4 +1,4 @@
-/* $Id: traps.c,v 1.68 2000/11/22 06:50:37 davem Exp $
+/* $Id: traps.c,v 1.70 2001/02/09 05:46:44 davem Exp $
  * arch/sparc64/kernel/traps.c
  *
  * Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu)
@@ -636,6 +636,30 @@
 	printk("Instruction DUMP:");
 	for(i = 0; i < 9; i++)
 		printk("%c%08x%c",i==3?' ':'<',buf[i],i==3?' ':'>');
+	printk("\n");
+}
+
+void show_trace_task(struct task_struct *tsk)
+{
+	unsigned long pc, fp;
+	unsigned long task_base = (unsigned long)tsk;
+	struct reg_window *rw;
+	int count = 0;
+
+	if (!tsk)
+		return;
+
+	fp = tsk->thread.ksp + STACK_BIAS;
+	do {
+		/* Bogus frame pointer? */
+		if (fp < (task_base + sizeof(struct task_struct)) ||
+		    fp >= (task_base + (2 * PAGE_SIZE)))
+			break;
+		rw = (struct reg_window *)fp;
+		pc = rw->ins[7];
+		printk("[%016lx] ", pc);
+		fp = rw->ins[6] + STACK_BIAS;
+	} while (++count < 16);
 	printk("\n");
 }
 
diff -urN linux-2.4.2-pre2/arch/sparc64/mm/init.c linux/arch/sparc64/mm/init.c
--- linux-2.4.2-pre2/arch/sparc64/mm/init.c	Mon Dec 11 12:37:03 2000
+++ linux/arch/sparc64/mm/init.c	Mon Dec  3 22:28:20 2001
@@ -12,7 +12,7 @@
 #include <linux/init.h>
 #include <linux/bootmem.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/swap.h>
 #include <linux/swapctl.h>
diff -urN linux-2.4.2-pre2/arch/sparc64/mm/modutil.c linux/arch/sparc64/mm/modutil.c
--- linux-2.4.2-pre2/arch/sparc64/mm/modutil.c	Wed Jul  5 12:14:54 2000
+++ linux/arch/sparc64/mm/modutil.c	Mon Dec  3 22:28:20 2001
@@ -5,7 +5,7 @@
  *  Based upon code written by Linus Torvalds and others.
  */
  
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/arch/sparc64/solaris/fs.c linux/arch/sparc64/solaris/fs.c
--- linux-2.4.2-pre2/arch/sparc64/solaris/fs.c	Tue Aug 29 14:09:15 2000
+++ linux/arch/sparc64/solaris/fs.c	Mon Dec  3 22:28:20 2001
@@ -9,7 +9,7 @@
 
 #include <linux/types.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/file.h>
diff -urN linux-2.4.2-pre2/arch/sparc64/solaris/socket.c linux/arch/sparc64/solaris/socket.c
--- linux-2.4.2-pre2/arch/sparc64/solaris/socket.c	Tue Nov 28 21:53:44 2000
+++ linux/arch/sparc64/solaris/socket.c	Mon Dec  3 22:28:20 2001
@@ -10,7 +10,7 @@
 #include <linux/types.h>
 #include <linux/smp_lock.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/socket.h>
 #include <linux/file.h>
 
diff -urN linux-2.4.2-pre2/arch/sparc64/solaris/socksys.c linux/arch/sparc64/solaris/socksys.c
--- linux-2.4.2-pre2/arch/sparc64/solaris/socksys.c	Mon Oct 23 15:48:27 2000
+++ linux/arch/sparc64/solaris/socksys.c	Mon Dec  3 22:28:20 2001
@@ -16,7 +16,7 @@
 #include <linux/file.h>
 #include <linux/init.h>
 #include <linux/poll.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/in.h>
 #include <linux/devfs_fs_kernel.h>
 
diff -urN linux-2.4.2-pre2/drivers/acorn/char/keyb_arc.c linux/drivers/acorn/char/keyb_arc.c
--- linux-2.4.2-pre2/drivers/acorn/char/keyb_arc.c	Mon Sep 18 15:15:21 2000
+++ linux/drivers/acorn/char/keyb_arc.c	Mon Dec  3 22:28:20 2001
@@ -19,7 +19,7 @@
 #include <linux/tty.h>
 #include <linux/tty_flip.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ptrace.h>
 #include <linux/signal.h>
 #include <linux/timer.h>
diff -urN linux-2.4.2-pre2/drivers/acorn/char/keyb_ps2.c linux/drivers/acorn/char/keyb_ps2.c
--- linux-2.4.2-pre2/drivers/acorn/char/keyb_ps2.c	Mon Sep 18 15:15:21 2000
+++ linux/drivers/acorn/char/keyb_ps2.c	Mon Dec  3 22:28:20 2001
@@ -17,7 +17,7 @@
 #include <linux/tty.h>
 #include <linux/tty_flip.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ptrace.h>
 #include <linux/signal.h>
 #include <linux/timer.h>
diff -urN linux-2.4.2-pre2/drivers/acorn/char/pcf8583.c linux/drivers/acorn/char/pcf8583.c
--- linux-2.4.2-pre2/drivers/acorn/char/pcf8583.c	Mon Sep 18 15:15:21 2000
+++ linux/drivers/acorn/char/pcf8583.c	Mon Dec  3 22:28:20 2001
@@ -10,7 +10,7 @@
  *  Driver for PCF8583 RTC & RAM chip
  */
 #include <linux/i2c.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/mc146818rtc.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/acorn/net/ether1.c linux/drivers/acorn/net/ether1.c
--- linux-2.4.2-pre2/drivers/acorn/net/ether1.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/acorn/net/ether1.c	Mon Dec  3 22:28:20 2001
@@ -40,7 +40,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/acorn/net/ether3.c linux/drivers/acorn/net/ether3.c
--- linux-2.4.2-pre2/drivers/acorn/net/ether3.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/acorn/net/ether3.c	Mon Dec  3 22:28:20 2001
@@ -55,7 +55,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/netdevice.h>
diff -urN linux-2.4.2-pre2/drivers/acorn/net/etherh.c linux/drivers/acorn/net/etherh.c
--- linux-2.4.2-pre2/drivers/acorn/net/etherh.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/acorn/net/etherh.c	Mon Dec  3 22:28:20 2001
@@ -36,7 +36,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/netdevice.h>
diff -urN linux-2.4.2-pre2/drivers/acorn/scsi/queue.c linux/drivers/acorn/scsi/queue.c
--- linux-2.4.2-pre2/drivers/acorn/scsi/queue.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/acorn/scsi/queue.c	Mon Dec  3 22:28:20 2001
@@ -18,7 +18,7 @@
 #include <linux/blk.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/list.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/acpi/acpi_ksyms.c linux/drivers/acpi/acpi_ksyms.c
--- linux-2.4.2-pre2/drivers/acpi/acpi_ksyms.c	Mon Jan 29 10:15:58 2001
+++ linux/drivers/acpi/acpi_ksyms.c	Mon Dec  3 22:28:20 2001
@@ -18,6 +18,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
diff -urN linux-2.4.2-pre2/drivers/acpi/cmbatt.c linux/drivers/acpi/cmbatt.c
--- linux-2.4.2-pre2/drivers/acpi/cmbatt.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/acpi/cmbatt.c	Mon Dec  3 22:28:20 2001
@@ -24,6 +24,8 @@
  * - parse returned data from _BST and _BIF
  * Andy Grover <andrew.grover@intel.com> 2000-12-8
  * - improved proc interface
+ * Pavel Machek <pavel@suse.cz> 2001-1-31
+ * - fixed oops on NULLs in return from _BIF
  */
 
 #include <linux/kernel.h>
@@ -44,6 +46,8 @@
 #define MAX_CM_BATTERIES	0x8
 #define MAX_BATT_STRLEN		0x20
 
+#define Xstrncpy(a, b, c) if (b) strncpy(a,b,c); else strncpy(a, "unknown", c)
+
 struct cmbatt_info
 {
 	u32  power_unit;
@@ -163,9 +167,7 @@
 	result->battery_capacity_granularity_1=objs[7].integer.value;
 	result->battery_capacity_granularity_2=objs[8].integer.value;
 
-#define Xstrncpy(a, b, c) if (b) strncpy(a,b,c); else strncpy(a, "unknown", c);
-
-	/* BUG: trailing NULL issue */
+ 	/* BUG: trailing NULL issue */
 	Xstrncpy(result->model_number, objs[9].string.pointer, MAX_BATT_STRLEN-1);
 	Xstrncpy(result->serial_number, objs[10].string.pointer, MAX_BATT_STRLEN-1);
 	Xstrncpy(result->battery_type, objs[11].string.pointer, MAX_BATT_STRLEN-1);
@@ -248,38 +250,32 @@
 		goto end;
 	}
 
-	if (info->last_full_capacity == ACPI_BATT_UNKNOWN)
-		p += sprintf(p, "Unknown last full capacity\n");
-	else
-		p += sprintf(p, "Last Full Capacity %x %s /hr\n", 
+	if (info->last_full_capacity != ACPI_BATT_UNKNOWN)
+		p += sprintf(p, "Last Full Capacity: %d %sh\n", 
 		     info->last_full_capacity, batt_list[batt_num].power_unit);
 
-	if (info->design_capacity == ACPI_BATT_UNKNOWN)
-		p += sprintf(p, "Unknown Design Capacity\n");
-	else
-		p += sprintf(p, "Design Capacity %x %s /hr\n", 
+	if (info->design_capacity != ACPI_BATT_UNKNOWN)
+		p += sprintf(p, "Design Capacity:    %d %sh\n", 
 		     info->design_capacity, batt_list[batt_num].power_unit);
 	
 	if (info->battery_technology)
-		p += sprintf(p, "Secondary Battery Technology\n");
+		p += sprintf(p, "Battery Technology: Secondary\n");
 	else
-		p += sprintf(p, "Primary Battery Technology\n");
+		p += sprintf(p, "Battery Technology: Primary\n");
 	
-	if (info->design_voltage == ACPI_BATT_UNKNOWN)
-		p += sprintf(p, "Unknown Design Voltage\n");
-	else
-		p += sprintf(p, "Design Voltage %x mV\n", 
+	if (info->design_voltage != ACPI_BATT_UNKNOWN)
+		p += sprintf(p, "Design Voltage:     %d mV\n", 
 		     info->design_voltage);
 	
-	p += sprintf(p, "Design Capacity Warning %d\n",
-		info->design_capacity_warning);
-	p += sprintf(p, "Design Capacity Low %d\n",
-		info->design_capacity_low);
-	p += sprintf(p, "Battery Capacity Granularity 1 %d\n",
+	p += sprintf(p, "Design Capacity Warning:    %d %sh\n",
+		info->design_capacity_warning, batt_list[batt_num].power_unit);
+	p += sprintf(p, "Design Capacity Low:        %d %sh\n",
+		info->design_capacity_low, batt_list[batt_num].power_unit);
+	p += sprintf(p, "Battery Capacity Granularity 1: %d\n",
 		info->battery_capacity_granularity_1);
-	p += sprintf(p, "Battery Capacity Granularity 2 %d\n",
+	p += sprintf(p, "Battery Capacity Granularity 2: %d\n",
 		info->battery_capacity_granularity_2);
-	p += sprintf(p, "model number %s\nserial number %s\nbattery type %s\nOEM info %s\n",
+	p += sprintf(p, "Model number; %s\nSerial number: %s\nBattery type: %s\nOEM info: %s\n",
 		info->model_number,info->serial_number,
 		info->battery_type,info->oem_info);
 end:
@@ -310,38 +306,28 @@
 		goto end;
 	}
 
-	printk("getting batt status\n");
-
 	if (acpi_get_battery_status(batt_list[batt_num].handle, &status) != AE_OK) {
 		printk(KERN_ERR "Cmbatt: acpi_get_battery_status failed\n");
 		goto end;
 	}
 
-	p += sprintf(p, "Remaining Capacity: %x\n", status.remaining_capacity);
+	p += sprintf(p, "Battery discharging:        %s\n",
+		     (status.state & 0x1)?"yes":"no");
+	p += sprintf(p, "Battery charging:           %s\n",
+		     (status.state & 0x2)?"yes":"no");
+	p += sprintf(p, "Battery critically low:     %s\n",
+		     (status.state & 0x4)?"yes":"no");
+
+	if (status.present_rate != ACPI_BATT_UNKNOWN)
+		p += sprintf(p, "Battery rate:               %d %s\n",
+			status.present_rate, batt_list[batt_num].power_unit);
 
-	if (status.state & 0x1)
-		p += sprintf(p, "Battery discharging\n");
-	if (status.state & 0x2)
-		p += sprintf(p, "Battery charging\n");
-	if (status.state & 0x4)
-		p += sprintf(p, "Battery critically low\n");
-
-	if (status.present_rate == ACPI_BATT_UNKNOWN)
-		p += sprintf(p, "Battery rate unknown\n");
-	else
-		p += sprintf(p, "Battery rate %x\n",
-			status.present_rate);
-
-	if (status.remaining_capacity == ACPI_BATT_UNKNOWN)
-		p += sprintf(p, "Battery capacity unknown\n");
-	else
-		p += sprintf(p, "Battery capacity %x %s\n",
+	if (status.remaining_capacity != ACPI_BATT_UNKNOWN)
+		p += sprintf(p, "Battery capacity:           %d %sh\n",
 			status.remaining_capacity, batt_list[batt_num].power_unit);
 
-	if (status.present_voltage == ACPI_BATT_UNKNOWN)
-		p += sprintf(p, "Battery voltage unknown\n");
-	else
-		p += sprintf(p, "Battery voltage %x volts\n",
+	if (status.present_voltage != ACPI_BATT_UNKNOWN)
+		p += sprintf(p, "Battery voltage:            %d mV\n",
 			status.present_voltage);
 
 end:
diff -urN linux-2.4.2-pre2/drivers/acpi/common/cmcopy.c linux/drivers/acpi/common/cmcopy.c
--- linux-2.4.2-pre2/drivers/acpi/common/cmcopy.c	Mon Jan 22 13:23:42 2001
+++ linux/drivers/acpi/common/cmcopy.c	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Module Name: cmcopy - Internal to external object translation utilities
- *              $Revision: 62 $
+ *              $Revision: 66 $
  *
  *****************************************************************************/
 
@@ -27,51 +27,39 @@
 #include "acpi.h"
 #include "acinterp.h"
 #include "acnamesp.h"
+#include "amlcode.h"
 
 
 #define _COMPONENT          MISCELLANEOUS
 	 MODULE_NAME         ("cmcopy")
 
 
-typedef struct search_st
-{
-	ACPI_OPERAND_OBJECT         *internal_obj;
-	u32                         index;
-	ACPI_OBJECT                 *external_obj;
-
-} PKG_SEARCH_INFO;
-
-
-/* Used to traverse nested packages */
-
-PKG_SEARCH_INFO                 level[MAX_PACKAGE_DEPTH];
-
-/******************************************************************************
+/*******************************************************************************
  *
- * FUNCTION:    Acpi_cm_build_external_simple_object
+ * FUNCTION:    Acpi_cm_copy_isimple_to_esimple
  *
- * PARAMETERS:  *Internal_obj   - Pointer to the object we are examining
- *              *Buffer         - Where the object is returned
- *              *Space_used     - Where the data length is returned
+ * PARAMETERS:  *Internal_object    - Pointer to the object we are examining
+ *              *Buffer             - Where the object is returned
+ *              *Space_used         - Where the data length is returned
  *
- * RETURN:      Status          - the status of the call
+ * RETURN:      Status
  *
  * DESCRIPTION: This function is called to place a simple object in a user
- *                  buffer.
+ *              buffer.
  *
  *              The buffer is assumed to have sufficient space for the object.
  *
  ******************************************************************************/
 
 static ACPI_STATUS
-acpi_cm_build_external_simple_object (
-	ACPI_OPERAND_OBJECT     *internal_obj,
-	ACPI_OBJECT             *external_obj,
+acpi_cm_copy_isimple_to_esimple (
+	ACPI_OPERAND_OBJECT     *internal_object,
+	ACPI_OBJECT             *external_object,
 	u8                      *data_space,
 	u32                     *buffer_space_used)
 {
 	u32                     length = 0;
-	u8                      *source_ptr = NULL;
+	ACPI_STATUS             status = AE_OK;
 
 
 	/*
@@ -79,116 +67,221 @@
 	 * package element
 	 */
 
-	if (!internal_obj) {
+	if (!internal_object) {
 		*buffer_space_used = 0;
 		return (AE_OK);
 	}
 
 	/* Always clear the external object */
 
-	MEMSET (external_obj, 0, sizeof (ACPI_OBJECT));
+	MEMSET (external_object, 0, sizeof (ACPI_OBJECT));
 
 	/*
 	 * In general, the external object will be the same type as
 	 * the internal object
 	 */
 
-	external_obj->type = internal_obj->common.type;
+	external_object->type = internal_object->common.type;
 
 	/* However, only a limited number of external types are supported */
 
-	switch (external_obj->type)
+	switch (internal_object->common.type)
 	{
 
 	case ACPI_TYPE_STRING:
 
-		length = internal_obj->string.length + 1;
-		external_obj->string.length = internal_obj->string.length;
-		external_obj->string.pointer = (NATIVE_CHAR *) data_space;
-		source_ptr = (u8 *) internal_obj->string.pointer;
+		length = internal_object->string.length + 1;
+		external_object->string.length = internal_object->string.length;
+		external_object->string.pointer = (NATIVE_CHAR *) data_space;
+		MEMCPY ((void *) data_space, (void *) internal_object->string.pointer, length);
 		break;
 
 
 	case ACPI_TYPE_BUFFER:
 
-		length = internal_obj->buffer.length;
-		external_obj->buffer.length = internal_obj->buffer.length;
-		external_obj->buffer.pointer = data_space;
-		source_ptr = (u8 *) internal_obj->buffer.pointer;
+		length = internal_object->buffer.length;
+		external_object->buffer.length = internal_object->buffer.length;
+		external_object->buffer.pointer = data_space;
+		MEMCPY ((void *) data_space, (void *) internal_object->buffer.pointer, length);
 		break;
 
 
 	case ACPI_TYPE_INTEGER:
 
-		external_obj->integer.value= internal_obj->integer.value;
+		external_object->integer.value= internal_object->integer.value;
 		break;
 
 
 	case INTERNAL_TYPE_REFERENCE:
 
 		/*
-		 * This is an object reference.  We use the object type of "Any"
-		 * to indicate a reference object containing a handle to an ACPI
-		 * named object.
+		 * This is an object reference.  Attempt to dereference it.
 		 */
 
-		external_obj->type = ACPI_TYPE_ANY;
-		external_obj->reference.handle = internal_obj->reference.node;
-		break;
+		switch (internal_object->reference.op_code)
+		{
+		case AML_ZERO_OP:
+			external_object->type = ACPI_TYPE_INTEGER;
+			external_object->integer.value = 0;
+			break;
+
+		case AML_ONE_OP:
+			external_object->type = ACPI_TYPE_INTEGER;
+			external_object->integer.value = 1;
+			break;
+
+		case AML_ONES_OP:
+			external_object->type = ACPI_TYPE_INTEGER;
+			external_object->integer.value = ACPI_INTEGER_MAX;
+			break;
 
+		case AML_NAMEPATH_OP:
+			/*
+			 * This is a named reference, get the string.  We already know that
+			 * we have room for it, use max length
+			 */
+			length = MAX_STRING_LENGTH;
+			external_object->type = ACPI_TYPE_STRING;
+			external_object->string.pointer = (NATIVE_CHAR *) data_space;
+			status = acpi_ns_handle_to_pathname ((ACPI_HANDLE *) internal_object->reference.node,
+					 &length, (char *) data_space);
+			break;
 
-	case ACPI_TYPE_PROCESSOR:
+		default:
+			/*
+			 * Use the object type of "Any" to indicate a reference
+			 * to object containing a handle to an ACPI named object.
+			 */
+			external_object->type = ACPI_TYPE_ANY;
+			external_object->reference.handle = internal_object->reference.node;
+			break;
+		}
+		break;
 
-		external_obj->processor.proc_id =
-				 internal_obj->processor.proc_id;
 
-		external_obj->processor.pblk_address =
-				 internal_obj->processor.address;
+	case ACPI_TYPE_PROCESSOR:
 
-		external_obj->processor.pblk_length =
-				 internal_obj->processor.length;
+		external_object->processor.proc_id = internal_object->processor.proc_id;
+		external_object->processor.pblk_address = internal_object->processor.address;
+		external_object->processor.pblk_length = internal_object->processor.length;
 		break;
 
+
 	case ACPI_TYPE_POWER:
 
-		external_obj->power_resource.system_level =
-				   internal_obj->power_resource.system_level;
+		external_object->power_resource.system_level =
+				   internal_object->power_resource.system_level;
 
-		external_obj->power_resource.resource_order =
-				   internal_obj->power_resource.resource_order;
+		external_object->power_resource.resource_order =
+				   internal_object->power_resource.resource_order;
 		break;
 
+
 	default:
-		return (AE_CTRL_RETURN_VALUE);
+		/*
+		 * There is no corresponding external object type
+		 */
+		return (AE_SUPPORT);
 		break;
 	}
 
 
-	/* Copy data if necessary (strings or buffers) */
+	*buffer_space_used = (u32) ROUND_UP_TO_NATIVE_WORD (length);
+
+	return (status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    Acpi_cm_copy_ielement_to_eelement
+ *
+ * PARAMETERS:  ACPI_PKG_CALLBACK
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Copy one package element to another package element
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+acpi_cm_copy_ielement_to_eelement (
+	u8                      object_type,
+	ACPI_OPERAND_OBJECT     *source_object,
+	ACPI_GENERIC_STATE      *state,
+	void                    *context)
+{
+	ACPI_STATUS             status = AE_OK;
+	ACPI_PKG_INFO           *info = (ACPI_PKG_INFO *) context;
+	u32                     object_space;
+	u32                     this_index;
+	ACPI_OBJECT             *target_object;
+
+
+	this_index      = state->pkg.index;
+	target_object   = (ACPI_OBJECT *)
+			   &((ACPI_OBJECT *)(state->pkg.dest_object))->package.elements[this_index];
+
+
+	switch (object_type)
+	{
+	case 0:
 
-	if (length) {
 		/*
-		 * Copy the return data to the caller's buffer
+		 * This is a simple or null object -- get the size
 		 */
-		MEMCPY ((void *) data_space, (void *) source_ptr, length);
+
+		status = acpi_cm_copy_isimple_to_esimple (source_object,
+				  target_object, info->free_space, &object_space);
+		if (ACPI_FAILURE (status)) {
+			return (status);
+		}
+
+		break;
+
+	case 1:
+
+		/*
+		 * Build the package object
+		 */
+		target_object->type             = ACPI_TYPE_PACKAGE;
+		target_object->package.count    = source_object->package.count;
+		target_object->package.elements = (ACPI_OBJECT *) info->free_space;
+
+		/*
+		 * Pass the new package object back to the package walk routine
+		 */
+		state->pkg.this_target_obj = target_object;
+
+		/*
+		 * Save space for the array of objects (Package elements)
+		 * update the buffer length counter
+		 */
+		object_space = (u32) ROUND_UP_TO_NATIVE_WORD (
+				   target_object->package.count * sizeof (ACPI_OBJECT));
+		break;
+
+	default:
+		return (AE_BAD_PARAMETER);
 	}
 
 
-	*buffer_space_used = (u32) ROUND_UP_TO_NATIVE_WORD (length);
+	info->free_space  += object_space;
+	info->length      += object_space;
 
-	return (AE_OK);
+	return (status);
 }
 
 
-/******************************************************************************
+/*******************************************************************************
  *
- * FUNCTION:    Acpi_cm_build_external_package_object
+ * FUNCTION:    Acpi_cm_copy_ipackage_to_epackage
  *
- * PARAMETERS:  *Internal_obj   - Pointer to the object we are returning
- *              *Buffer         - Where the object is returned
- *              *Space_used     - Where the object length is returned
+ * PARAMETERS:  *Internal_object    - Pointer to the object we are returning
+ *              *Buffer             - Where the object is returned
+ *              *Space_used         - Where the object length is returned
  *
- * RETURN:      Status          - the status of the call
+ * RETURN:      Status
  *
  * DESCRIPTION: This function is called to place a package object in a user
  *              buffer.  A package object by definition contains other objects.
@@ -200,49 +293,33 @@
  ******************************************************************************/
 
 static ACPI_STATUS
-acpi_cm_build_external_package_object (
-	ACPI_OPERAND_OBJECT     *internal_obj,
+acpi_cm_copy_ipackage_to_epackage (
+	ACPI_OPERAND_OBJECT     *internal_object,
 	u8                      *buffer,
 	u32                     *space_used)
 {
-	u8                      *free_space;
-	ACPI_OBJECT             *external_obj;
-	u32                     current_depth = 0;
+	ACPI_OBJECT             *external_object;
 	ACPI_STATUS             status;
-	u32                     length = 0;
-	u32                     this_index;
-	u32                     object_space;
-	ACPI_OPERAND_OBJECT     *this_internal_obj;
-	ACPI_OBJECT             *this_external_obj;
-	PKG_SEARCH_INFO         *level_ptr;
+	ACPI_PKG_INFO           info;
 
 
 	/*
 	 * First package at head of the buffer
 	 */
-	external_obj = (ACPI_OBJECT *) buffer;
+	external_object = (ACPI_OBJECT *) buffer;
 
 	/*
 	 * Free space begins right after the first package
 	 */
-	free_space = buffer + ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
-
-
-	/*
-	 * Initialize the working variables
-	 */
+	info.length      = 0;
+	info.object_space = 0;
+	info.num_packages = 1;
+	info.free_space  = buffer + ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
 
-	MEMSET ((void *) level, 0, sizeof (level));
 
-	level[0].internal_obj   = internal_obj;
-	level[0].external_obj   = external_obj;
-	level[0].index          = 0;
-	level_ptr               = &level[0];
-	current_depth           = 0;
-
-	external_obj->type              = internal_obj->common.type;
-	external_obj->package.count     = internal_obj->package.count;
-	external_obj->package.elements  = (ACPI_OBJECT *) free_space;
+	external_object->type              = internal_object->common.type;
+	external_object->package.count     = internal_object->package.count;
+	external_object->package.elements  = (ACPI_OBJECT *) info.free_space;
 
 
 	/*
@@ -250,136 +327,27 @@
 	 * and move the free space past it
 	 */
 
-	free_space += external_obj->package.count *
+	info.free_space += external_object->package.count *
 			  ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
 
 
-	while (1) {
-		this_index      = level_ptr->index;
-		this_internal_obj =
-				(ACPI_OPERAND_OBJECT  *)
-				level_ptr->internal_obj->package.elements[this_index];
-		this_external_obj =
-				(ACPI_OBJECT *)
-				&level_ptr->external_obj->package.elements[this_index];
-
+	status = acpi_cm_walk_package_tree (internal_object, external_object,
+			 acpi_cm_copy_ielement_to_eelement, &info);
 
-		/*
-		 * Check for
-		 * 1) Null object -- OK, this can happen if package
-		 *              element is never initialized
-		 * 2) Not an internal object - can be Node instead
-		 * 3) Any internal object other than a package.
-		 *
-		 * The more complex package case is handled later
-		 */
+	*space_used = info.length;
 
-		if ((!this_internal_obj) ||
-			(!VALID_DESCRIPTOR_TYPE (
-				this_internal_obj, ACPI_DESC_TYPE_INTERNAL)) ||
-			(!IS_THIS_OBJECT_TYPE (
-				this_internal_obj, ACPI_TYPE_PACKAGE)))
-		{
-			/*
-			 * This is a simple or null object -- get the size
-			 */
-
-			status =
-				acpi_cm_build_external_simple_object (this_internal_obj,
-						   this_external_obj,
-						   free_space,
-						   &object_space);
-			if (ACPI_FAILURE (status)) {
-				return (status);
-			}
-
-			free_space  += object_space;
-			length      += object_space;
-
-			level_ptr->index++;
-			while (level_ptr->index >=
-					level_ptr->internal_obj->package.count)
-			{
-				/*
-				 * We've handled all of the objects at this
-				 * level.  This means that we have just
-				 * completed a package.  That package may
-				 * have contained one or more packages
-				 * itself
-				 */
-				if (current_depth == 0) {
-					/*
-					 * We have handled all of the objects
-					 * in the top level package just add
-					 * the length of the package objects
-					 * and get out
-					 */
-					*space_used = length;
-					return (AE_OK);
-				}
-
-				/*
-				 * go back up a level and move the index
-				 * past the just completed package object.
-				 */
-				current_depth--;
-				level_ptr = &level[current_depth];
-				level_ptr->index++;
-			}
-		}
-
-
-		else {
-			/*
-			 * This object is a package
-			 * -- we must go one level deeper
-			 */
-			if (current_depth >= MAX_PACKAGE_DEPTH-1) {
-				/*
-				 * Too many nested levels of packages
-				 * for us to handle
-				 */
-				return (AE_LIMIT);
-			}
-
-			/*
-			 * Build the package object
-			 */
-			this_external_obj->type = ACPI_TYPE_PACKAGE;
-			this_external_obj->package.count =
-					 this_internal_obj->package.count;
-			this_external_obj->package.elements =
-					  (ACPI_OBJECT *) free_space;
+	return (status);
 
-			/*
-			 * Save space for the array of objects (Package elements)
-			 * update the buffer length counter
-			 */
-			object_space = (u32) ROUND_UP_TO_NATIVE_WORD (
-					   this_external_obj->package.count *
-					   sizeof (ACPI_OBJECT));
-
-			free_space              += object_space;
-			length                  += object_space;
-
-			current_depth++;
-			level_ptr               = &level[current_depth];
-			level_ptr->internal_obj = this_internal_obj;
-			level_ptr->external_obj = this_external_obj;
-			level_ptr->index        = 0;
-		}
-	}
 }
 
-
-/******************************************************************************
+/*******************************************************************************
  *
- * FUNCTION:    Acpi_cm_build_external_object
+ * FUNCTION:    Acpi_cm_copy_iobject_to_eobject
  *
- * PARAMETERS:  *Internal_obj   - The internal object to be converted
- *              *Buffer_ptr     - Where the object is returned
+ * PARAMETERS:  *Internal_object    - The internal object to be converted
+ *              *Buffer_ptr         - Where the object is returned
  *
- * RETURN:      Status          - the status of the call
+ * RETURN:      Status
  *
  * DESCRIPTION: This function is called to build an API object to be returned to
  *              the caller.
@@ -387,35 +355,31 @@
  ******************************************************************************/
 
 ACPI_STATUS
-acpi_cm_build_external_object (
-	ACPI_OPERAND_OBJECT     *internal_obj,
+acpi_cm_copy_iobject_to_eobject (
+	ACPI_OPERAND_OBJECT     *internal_object,
 	ACPI_BUFFER             *ret_buffer)
 {
 	ACPI_STATUS             status;
 
 
-	if (IS_THIS_OBJECT_TYPE (internal_obj, ACPI_TYPE_PACKAGE)) {
+	if (IS_THIS_OBJECT_TYPE (internal_object, ACPI_TYPE_PACKAGE)) {
 		/*
-		 * Package objects contain other objects (which can be objects)
-		 * buildpackage does it all
+		 * Package object:  Copy all subobjects (including
+		 * nested packages)
 		 */
-		status =
-			acpi_cm_build_external_package_object (internal_obj,
-					 ret_buffer->pointer,
-					 &ret_buffer->length);
+		status = acpi_cm_copy_ipackage_to_epackage (internal_object,
+				  ret_buffer->pointer, &ret_buffer->length);
 	}
 
 	else {
 		/*
 		 * Build a simple object (no nested objects)
 		 */
-		status =
-			acpi_cm_build_external_simple_object (internal_obj,
-					  (ACPI_OBJECT *) ret_buffer->pointer,
-					  ((u8 *) ret_buffer->pointer +
-					  ROUND_UP_TO_NATIVE_WORD (
-							   sizeof (ACPI_OBJECT))),
-							&ret_buffer->length);
+		status = acpi_cm_copy_isimple_to_esimple (internal_object,
+				  (ACPI_OBJECT *) ret_buffer->pointer,
+				  ((u8 *) ret_buffer->pointer +
+				  ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT))),
+				  &ret_buffer->length);
 		/*
 		 * build simple does not include the object size in the length
 		 * so we add it in here
@@ -427,14 +391,14 @@
 }
 
 
-/******************************************************************************
+/*******************************************************************************
  *
- * FUNCTION:    Acpi_cm_build_internal_simple_object
+ * FUNCTION:    Acpi_cm_copy_esimple_to_isimple
  *
- * PARAMETERS:  *External_obj   - The external object to be converted
- *              *Internal_obj   - Where the internal object is returned
+ * PARAMETERS:  *External_object   - The external object to be converted
+ *              *Internal_object   - Where the internal object is returned
  *
- * RETURN:      Status          - the status of the call
+ * RETURN:      Status
  *
  * DESCRIPTION: This function copies an external object to an internal one.
  *              NOTE: Pointers can be copied, we don't need to copy data.
@@ -444,28 +408,28 @@
  ******************************************************************************/
 
 ACPI_STATUS
-acpi_cm_build_internal_simple_object (
-	ACPI_OBJECT             *external_obj,
-	ACPI_OPERAND_OBJECT     *internal_obj)
+acpi_cm_copy_esimple_to_isimple (
+	ACPI_OBJECT             *external_object,
+	ACPI_OPERAND_OBJECT     *internal_object)
 {
 
 
-	internal_obj->common.type = (u8) external_obj->type;
+	internal_object->common.type = (u8) external_object->type;
 
-	switch (external_obj->type)
+	switch (external_object->type)
 	{
 
 	case ACPI_TYPE_STRING:
 
-		internal_obj->string.length = external_obj->string.length;
-		internal_obj->string.pointer = external_obj->string.pointer;
+		internal_object->string.length = external_object->string.length;
+		internal_object->string.pointer = external_object->string.pointer;
 		break;
 
 
 	case ACPI_TYPE_BUFFER:
 
-		internal_obj->buffer.length = external_obj->buffer.length;
-		internal_obj->buffer.pointer = external_obj->buffer.pointer;
+		internal_object->buffer.length = external_object->buffer.length;
+		internal_object->buffer.pointer = external_object->buffer.pointer;
 		break;
 
 
@@ -473,7 +437,7 @@
 		/*
 		 * Number is included in the object itself
 		 */
-		internal_obj->integer.value  = external_obj->integer.value;
+		internal_object->integer.value  = external_object->integer.value;
 		break;
 
 
@@ -491,11 +455,11 @@
 
 /* Code to convert packages that are parameters to control methods */
 
-/******************************************************************************
+/*******************************************************************************
  *
- * FUNCTION:    Acpi_cm_build_internal_package_object
+ * FUNCTION:    Acpi_cm_copy_epackage_to_ipackage
  *
- * PARAMETERS:  *Internal_obj   - Pointer to the object we are returning
+ * PARAMETERS:  *Internal_object   - Pointer to the object we are returning
  *              *Buffer         - Where the object is returned
  *              *Space_used     - Where the length of the object is returned
  *
@@ -511,26 +475,24 @@
  ******************************************************************************/
 
 static ACPI_STATUS
-acpi_cm_build_internal_package_object (
-	ACPI_OPERAND_OBJECT     *internal_obj,
+acpi_cm_copy_epackage_to_ipackage (
+	ACPI_OPERAND_OBJECT     *internal_object,
 	u8                      *buffer,
 	u32                     *space_used)
 {
 	u8                      *free_space;
-	ACPI_OBJECT             *external_obj;
-	u32                     current_depth = 0;
+	ACPI_OBJECT             *external_object;
 	u32                     length = 0;
 	u32                     this_index;
 	u32                     object_space = 0;
 	ACPI_OPERAND_OBJECT     *this_internal_obj;
 	ACPI_OBJECT             *this_external_obj;
-	PKG_SEARCH_INFO         *level_ptr;
 
 
 	/*
 	 * First package at head of the buffer
 	 */
-	external_obj = (ACPI_OBJECT *)buffer;
+	external_object = (ACPI_OBJECT *)buffer;
 
 	/*
 	 * Free space begins right after the first package
@@ -538,20 +500,9 @@
 	free_space = buffer + sizeof(ACPI_OBJECT);
 
 
-	/*
-	 * Initialize the working variables
-	 */
-
-	MEMSET ((void *) level, 0, sizeof(level));
-
-	level[0].internal_obj   = internal_obj;
-	level[0].external_obj   = external_obj;
-	level_ptr               = &level[0];
-	current_depth           = 0;
-
-	external_obj->type              = internal_obj->common.type;
-	external_obj->package.count     = internal_obj->package.count;
-	external_obj->package.elements  = (ACPI_OBJECT *)free_space;
+	external_object->type              = internal_object->common.type;
+	external_object->package.count     = internal_object->package.count;
+	external_object->package.elements  = (ACPI_OBJECT *)free_space;
 
 
 	/*
@@ -559,100 +510,21 @@
 	 * and move the free space past it
 	 */
 
-	free_space += external_obj->package.count * sizeof(ACPI_OBJECT);
+	free_space += external_object->package.count * sizeof(ACPI_OBJECT);
 
 
-	while (1) {
-		this_index      = level_ptr->index;
-
-		this_internal_obj = (ACPI_OPERAND_OBJECT *)
-				 &level_ptr->internal_obj->package.elements[this_index];
-
-		this_external_obj = (ACPI_OBJECT *)
-				 &level_ptr->external_obj->package.elements[this_index];
-
-		if (IS_THIS_OBJECT_TYPE (this_internal_obj, ACPI_TYPE_PACKAGE)) {
-			/*
-			 * If this object is a package then we go one deeper
-			 */
-			if (current_depth >= MAX_PACKAGE_DEPTH-1) {
-				/*
-				 * Too many nested levels of packages for us to handle
-				 */
-				return (AE_LIMIT);
-			}
-
-			/*
-			 * Build the package object
-			 */
-			this_external_obj->type             = ACPI_TYPE_PACKAGE;
-			this_external_obj->package.count    = this_internal_obj->package.count;
-			this_external_obj->package.elements = (ACPI_OBJECT *) free_space;
-
-			/*
-			 * Save space for the array of objects (Package elements)
-			 * update the buffer length counter
-			 */
-			object_space            = this_external_obj->package.count *
-					   sizeof (ACPI_OBJECT);
-
-			free_space              += object_space;
-			length                  += object_space;
+	/* Call Walk_package */
 
-			current_depth++;
-			level_ptr               = &level[current_depth];
-			level_ptr->internal_obj = this_internal_obj;
-			level_ptr->external_obj = this_external_obj;
-			level_ptr->index        = 0;
-
-		}   /* if object is a package */
-
-		else {
-			free_space  += object_space;
-			length      += object_space;
-
-			level_ptr->index++;
-			while (level_ptr->index >=
-					level_ptr->internal_obj->package.count)
-			{
-				/*
-				 * We've handled all of the objects at
-				 * this level,  This means that we have
-				 * just completed a package.  That package
-				 * may have contained one or more packages
-				 * itself
-				 */
-				if (current_depth == 0) {
-					/*
-					 * We have handled all of the objects
-					 * in the top level package just add
-					 * the length of the package objects
-					 * and get out
-					 */
-					*space_used = length;
-					return (AE_OK);
-				}
-
-				/*
-				 * go back up a level and move the index
-				 * past the just completed package object.
-				 */
-				current_depth--;
-				level_ptr = &level[current_depth];
-				level_ptr->index++;
-			}
-		}   /* else object is NOT a package */
-	}   /* while (1)  */
 }
 
 #endif /* Future implementation */
 
 
-/******************************************************************************
+/*******************************************************************************
  *
- * FUNCTION:    Acpi_cm_build_internal_object
+ * FUNCTION:    Acpi_cm_copy_eobject_to_iobject
  *
- * PARAMETERS:  *Internal_obj   - The external object to be converted
+ * PARAMETERS:  *Internal_object   - The external object to be converted
  *              *Buffer_ptr     - Where the internal object is returned
  *
  * RETURN:      Status          - the status of the call
@@ -662,14 +534,14 @@
  ******************************************************************************/
 
 ACPI_STATUS
-acpi_cm_build_internal_object (
-	ACPI_OBJECT             *external_obj,
-	ACPI_OPERAND_OBJECT     *internal_obj)
+acpi_cm_copy_eobject_to_iobject (
+	ACPI_OBJECT             *external_object,
+	ACPI_OPERAND_OBJECT     *internal_object)
 {
 	ACPI_STATUS             status;
 
 
-	if (external_obj->type == ACPI_TYPE_PACKAGE) {
+	if (external_object->type == ACPI_TYPE_PACKAGE) {
 		/*
 		 * Package objects contain other objects (which can be objects)
 		 * buildpackage does it all
@@ -679,7 +551,7 @@
 		 * control methods only.  This is a very, very rare case.
 		 */
 /*
-		Status = Acpi_cm_build_internal_package_object(Internal_obj,
+		Status = Acpi_cm_copy_epackage_to_ipackage(Internal_object,
 				 Ret_buffer->Pointer,
 				 &Ret_buffer->Length);
 */
@@ -690,12 +562,146 @@
 		/*
 		 * Build a simple object (no nested objects)
 		 */
-		status = acpi_cm_build_internal_simple_object (external_obj, internal_obj);
+		status = acpi_cm_copy_esimple_to_isimple (external_object, internal_object);
 		/*
 		 * build simple does not include the object size in the length
 		 * so we add it in here
 		 */
 	}
+
+	return (status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    Acpi_cm_copy_ielement_to_ielement
+ *
+ * PARAMETERS:  ACPI_PKG_CALLBACK
+ *
+ * RETURN:      Status          - the status of the call
+ *
+ * DESCRIPTION: Copy one package element to another package element
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+acpi_cm_copy_ielement_to_ielement (
+	u8                      object_type,
+	ACPI_OPERAND_OBJECT     *source_object,
+	ACPI_GENERIC_STATE      *state,
+	void                    *context)
+{
+	ACPI_STATUS             status = AE_OK;
+	u32                     this_index;
+	ACPI_OPERAND_OBJECT     **this_target_ptr;
+	ACPI_OPERAND_OBJECT     *target_object;
+
+
+	this_index    = state->pkg.index;
+	this_target_ptr = (ACPI_OPERAND_OBJECT **)
+			   &state->pkg.dest_object->package.elements[this_index];
+
+	switch (object_type)
+	{
+	case 0:
+
+		/*
+		 * This is a simple object, just copy it
+		 */
+		target_object = acpi_cm_create_internal_object (source_object->common.type);
+		if (!target_object) {
+			return (AE_NO_MEMORY);
+		}
+
+		status = acpi_aml_store_object_to_object (source_object, target_object,
+				  (ACPI_WALK_STATE *) context);
+		if (ACPI_FAILURE (status)) {
+			return (status);
+		}
+
+		*this_target_ptr = target_object;
+		break;
+
+
+	case 1:
+		/*
+		 * This object is a package - go down another nesting level
+		 * Create and build the package object
+		 */
+		target_object = acpi_cm_create_internal_object (ACPI_TYPE_PACKAGE);
+		if (!target_object) {
+			/* TBD: must delete package created up to this point */
+
+			return (AE_NO_MEMORY);
+		}
+
+		target_object->package.count = source_object->package.count;
+
+		/*
+		 * Pass the new package object back to the package walk routine
+		 */
+		state->pkg.this_target_obj = target_object;
+
+		/*
+		 * Store the object pointer in the parent package object
+		 */
+		*this_target_ptr = target_object;
+		break;
+
+	default:
+		return (AE_BAD_PARAMETER);
+	}
+
+
+	return (status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    Acpi_cm_copy_ipackage_to_ipackage
+ *
+ * PARAMETERS:  *Source_obj     - Pointer to the source package object
+ *              *Dest_obj       - Where the internal object is returned
+ *
+ * RETURN:      Status          - the status of the call
+ *
+ * DESCRIPTION: This function is called to copy an internal package object
+ *              into another internal package object.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+acpi_cm_copy_ipackage_to_ipackage (
+	ACPI_OPERAND_OBJECT     *source_obj,
+	ACPI_OPERAND_OBJECT     *dest_obj,
+	ACPI_WALK_STATE         *walk_state)
+{
+	ACPI_STATUS             status = AE_OK;
+
+
+	dest_obj->common.type   = source_obj->common.type;
+	dest_obj->package.count = source_obj->package.count;
+
+
+	/*
+	 * Create the object array and walk the source package tree
+	 */
+
+	dest_obj->package.elements = acpi_cm_callocate ((source_obj->package.count + 1) *
+			 sizeof (void *));
+	dest_obj->package.next_element = dest_obj->package.elements;
+
+	if (!dest_obj->package.elements) {
+		REPORT_ERROR (
+			("Aml_build_copy_internal_package_object: Package allocation failure\n"));
+		return (AE_NO_MEMORY);
+	}
+
+
+	status = acpi_cm_walk_package_tree (source_obj, dest_obj,
+			 acpi_cm_copy_ielement_to_ielement, walk_state);
 
 	return (status);
 }
diff -urN linux-2.4.2-pre2/drivers/acpi/common/cmobject.c linux/drivers/acpi/common/cmobject.c
--- linux-2.4.2-pre2/drivers/acpi/common/cmobject.c	Mon Jan 22 13:23:42 2001
+++ linux/drivers/acpi/common/cmobject.c	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Module Name: cmobject - ACPI object create/delete/size/cache routines
- *              $Revision: 35 $
+ *              $Revision: 36 $
  *
  *****************************************************************************/
 
@@ -35,7 +35,7 @@
 	 MODULE_NAME         ("cmobject")
 
 
-/******************************************************************************
+/*******************************************************************************
  *
  * FUNCTION:    _Cm_create_internal_object
  *
@@ -49,11 +49,11 @@
  *
  * DESCRIPTION: Create and initialize a new internal object.
  *
- * NOTE:
- *      We always allocate the worst-case object descriptor because these
- *      objects are cached, and we want them to be one-size-satisifies-any-request.
- *      This in itself may not be the most memory efficient, but the efficiency
- *      of the object cache should more than make up for this!
+ * NOTE:        We always allocate the worst-case object descriptor because
+ *              these objects are cached, and we want them to be
+ *              one-size-satisifies-any-request.  This in itself may not be
+ *              the most memory efficient, but the efficiency of the object
+ *              cache should more than make up for this!
  *
  ******************************************************************************/
 
@@ -91,7 +91,7 @@
 }
 
 
-/******************************************************************************
+/*******************************************************************************
  *
  * FUNCTION:    Acpi_cm_valid_internal_object
  *
@@ -99,7 +99,7 @@
  *
  * RETURN:      Validate a pointer to be an ACPI_OPERAND_OBJECT
  *
- *****************************************************************************/
+ ******************************************************************************/
 
 u8
 acpi_cm_valid_internal_object (
@@ -136,7 +136,7 @@
 }
 
 
-/*****************************************************************************
+/*******************************************************************************
  *
  * FUNCTION:    _Cm_allocate_object_desc
  *
@@ -150,7 +150,7 @@
  * DESCRIPTION: Allocate a new object descriptor.  Gracefully handle
  *              error conditions.
  *
- ****************************************************************************/
+ ******************************************************************************/
 
 void *
 _cm_allocate_object_desc (
@@ -211,7 +211,7 @@
 }
 
 
-/*****************************************************************************
+/*******************************************************************************
  *
  * FUNCTION:    Acpi_cm_delete_object_desc
  *
@@ -221,7 +221,7 @@
  *
  * DESCRIPTION: Free an ACPI object descriptor or add it to the object cache
  *
- ****************************************************************************/
+ ******************************************************************************/
 
 void
 acpi_cm_delete_object_desc (
@@ -274,7 +274,7 @@
 }
 
 
-/******************************************************************************
+/*******************************************************************************
  *
  * FUNCTION:    Acpi_cm_delete_object_cache
  *
@@ -317,7 +317,7 @@
 }
 
 
-/*****************************************************************************
+/*******************************************************************************
  *
  * FUNCTION:    Acpi_cm_init_static_object
  *
@@ -329,7 +329,7 @@
  * DESCRIPTION: Initialize a static object.  Sets flags to disallow dynamic
  *              deletion of the object.
  *
- ****************************************************************************/
+ ******************************************************************************/
 
 void
 acpi_cm_init_static_object (
@@ -365,14 +365,14 @@
 }
 
 
-/******************************************************************************
+/*******************************************************************************
  *
  * FUNCTION:    Acpi_cm_get_simple_object_size
  *
- * PARAMETERS:  *Internal_obj   - Pointer to the object we are examining
- *              *Ret_length     - Where the length is returned
+ * PARAMETERS:  *Internal_object    - Pointer to the object we are examining
+ *              *Ret_length         - Where the length is returned
  *
- * RETURN:      Status          - the status of the call
+ * RETURN:      Status
  *
  * DESCRIPTION: This function is called to determine the space required to
  *              contain a simple object for return to an API user.
@@ -384,7 +384,7 @@
 
 ACPI_STATUS
 acpi_cm_get_simple_object_size (
-	ACPI_OPERAND_OBJECT     *internal_obj,
+	ACPI_OPERAND_OBJECT     *internal_object,
 	u32                     *obj_length)
 {
 	u32                     length;
@@ -393,7 +393,7 @@
 
 	/* Handle a null object (Could be a uninitialized package element -- which is legal) */
 
-	if (!internal_obj) {
+	if (!internal_object) {
 		*obj_length = 0;
 		return (AE_OK);
 	}
@@ -403,7 +403,7 @@
 
 	length = sizeof (ACPI_OBJECT);
 
-	if (VALID_DESCRIPTOR_TYPE (internal_obj, ACPI_DESC_TYPE_NAMED)) {
+	if (VALID_DESCRIPTOR_TYPE (internal_object, ACPI_DESC_TYPE_NAMED)) {
 		/* Object is a named object (reference), just return the length */
 
 		*obj_length = (u32) ROUND_UP_TO_NATIVE_WORD (length);
@@ -419,18 +419,18 @@
 	 * TBD:[Investigate] do strings and buffers require alignment also?
 	 */
 
-	switch (internal_obj->common.type)
+	switch (internal_object->common.type)
 	{
 
 	case ACPI_TYPE_STRING:
 
-		length += internal_obj->string.length + 1;
+		length += internal_object->string.length + 1;
 		break;
 
 
 	case ACPI_TYPE_BUFFER:
 
-		length += internal_obj->buffer.length;
+		length += internal_object->buffer.length;
 		break;
 
 
@@ -450,7 +450,7 @@
 		 * The only type that should be here is opcode AML_NAMEPATH_OP -- since
 		 * this means an object reference
 		 */
-		if (internal_obj->reference.op_code != AML_NAMEPATH_OP) {
+		if (internal_object->reference.op_code != AML_NAMEPATH_OP) {
 			status = AE_TYPE;
 		}
 		break;
@@ -475,149 +475,119 @@
 }
 
 
-/******************************************************************************
+/*******************************************************************************
  *
- * FUNCTION:    Acpi_cm_get_package_object_size
+ * FUNCTION:    Acpi_cm_copy_package_to_internal
  *
- * PARAMETERS:  *Internal_obj   - Pointer to the object we are examining
- *              *Ret_length     - Where the length is returned
+ * PARAMETERS:  ACPI_PKG_CALLBACK
  *
  * RETURN:      Status          - the status of the call
  *
- * DESCRIPTION: This function is called to determine the space required to contain
- *              a package object for return to an API user.
- *
- *              This is moderately complex since a package contains other objects
- *              including packages.
+ * DESCRIPTION:
  *
  ******************************************************************************/
 
 ACPI_STATUS
-acpi_cm_get_package_object_size (
-	ACPI_OPERAND_OBJECT     *internal_obj,
-	u32                     *obj_length)
+acpi_cm_get_element_length (
+	u8                      object_type,
+	ACPI_OPERAND_OBJECT     *source_object,
+	ACPI_GENERIC_STATE      *state,
+	void                    *context)
 {
-
-	ACPI_OPERAND_OBJECT     *this_internal_obj;
-	ACPI_OPERAND_OBJECT     *parent_obj[MAX_PACKAGE_DEPTH];
-	ACPI_OPERAND_OBJECT     *this_parent;
-	u32                     this_index;
-	u32                     index[MAX_PACKAGE_DEPTH];
-	u32                     length = 0;
+	ACPI_STATUS             status = AE_OK;
+	ACPI_PKG_INFO           *info = (ACPI_PKG_INFO *) context;
 	u32                     object_space;
-	u32                     current_depth = 0;
-	u32                     package_count = 1;
-	ACPI_STATUS             status;
 
 
-	/* Init the package stack TBD: replace with linked list */
+	switch (object_type)
+	{
+	case 0:
 
-	MEMSET(parent_obj, 0, MAX_PACKAGE_DEPTH);
-	MEMSET(index, 0, MAX_PACKAGE_DEPTH);
+		/*
+		 * Simple object - just get the size (Null object/entry is handled
+		 * here also) and sum it into the running package length
+		 */
+		status = acpi_cm_get_simple_object_size (source_object, &object_space);
+		if (ACPI_FAILURE (status)) {
+			return (status);
+		}
 
-	parent_obj[0] = internal_obj;
+		info->length += object_space;
+		break;
 
-	while (1) {
-		this_parent     = parent_obj[current_depth];
-		this_index      = index[current_depth];
-		this_internal_obj = this_parent->package.elements[this_index];
 
+	case 1:
+		/* Package - nothing much to do here, let the walk handle it */
 
-		/*
-		 * Check for 1) An uninitialized package element.  It is completely
-		 *              legal to declare a package and leave it uninitialized
-		 *           2) Any type other than a package.  Packages are handled
-		 *              below.
-		 */
+		info->num_packages++;
+		state->pkg.this_target_obj = NULL;
+		break;
 
-		if ((!this_internal_obj) ||
-			(!IS_THIS_OBJECT_TYPE (this_internal_obj, ACPI_TYPE_PACKAGE)))
-		{
-			/*
-			 * Simple object - just get the size (Null object/entry handled
-			 *  also)
-			 */
-
-			status =
-				acpi_cm_get_simple_object_size (this_internal_obj, &object_space);
-
-			if (ACPI_FAILURE (status)) {
-				return (status);
-			}
-
-			length += object_space;
-
-			index[current_depth]++;
-			while (index[current_depth] >=
-				parent_obj[current_depth]->package.count)
-			{
-				/*
-				 * We've handled all of the objects at
-				 * this level,  This means that we have
-				 * just completed a package.  That package
-				 * may have contained one or more packages
-				 * itself.
-				 */
-				if (current_depth == 0) {
-					/*
-					 * We have handled all of the objects
-					 * in the top level package just add the
-					 * length of the package objects and
-					 * get out. Round up to the next machine
-					 * word.
-					 */
-					length +=
-						ROUND_UP_TO_NATIVE_WORD (
-								sizeof (ACPI_OBJECT)) *
-								package_count;
-
-					*obj_length = length;
-
-					return (AE_OK);
-				}
-
-				/*
-				 * Go back up a level and move the index
-				 * past the just completed package object.
-				 */
-				current_depth--;
-				index[current_depth]++;
-			}
-		}
+	default:
+		return (AE_BAD_PARAMETER);
+	}
 
-		else {
-			/*
-			 * This object is a package
-			 * -- go one level deeper
-			 */
-			package_count++;
-			if (current_depth < MAX_PACKAGE_DEPTH-1) {
-				current_depth++;
-				parent_obj[current_depth] = this_internal_obj;
-				index[current_depth]    = 0;
-			}
-
-			else {
-				/*
-				 * Too many nested levels of packages for us
-				 * to handle
-				 */
 
-				return (AE_LIMIT);
-			}
-		}
-	}
+	return (status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    Acpi_cm_get_package_object_size
+ *
+ * PARAMETERS:  *Internal_object    - Pointer to the object we are examining
+ *              *Ret_length         - Where the length is returned
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: This function is called to determine the space required to
+ *              contain a package object for return to an API user.
+ *
+ *              This is moderately complex since a package contains other
+ *              objects including packages.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+acpi_cm_get_package_object_size (
+	ACPI_OPERAND_OBJECT     *internal_object,
+	u32                     *obj_length)
+{
+	ACPI_STATUS             status;
+	ACPI_PKG_INFO           info;
+
+
+	info.length      = 0;
+	info.object_space = 0;
+	info.num_packages = 1;
+
+	status = acpi_cm_walk_package_tree (internal_object, NULL,
+			 acpi_cm_get_element_length, &info);
+
+	/*
+	 * We have handled all of the objects in all levels of the package.
+	 * just add the length of the package objects themselves.
+	 * Round up to the next machine word.
+	 */
+	info.length += ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT)) *
+			  info.num_packages;
+
+	/* Return the total package length */
+
+	*obj_length = info.length;
+	return (status);
 }
 
 
-/******************************************************************************
+/*******************************************************************************
  *
  * FUNCTION:    Acpi_cm_get_object_size
  *
- * PARAMETERS:  *Internal_obj   - Pointer to the object we are examining
- *              *Ret_length     - Where the length will be returned
+ * PARAMETERS:  *Internal_object    - Pointer to the object we are examining
+ *              *Ret_length         - Where the length will be returned
  *
- * RETURN:      Status          - the status of the call
+ * RETURN:      Status
  *
  * DESCRIPTION: This function is called to determine the space required to
  *              contain an object for return to an API user.
@@ -626,22 +596,20 @@
 
 ACPI_STATUS
 acpi_cm_get_object_size(
-	ACPI_OPERAND_OBJECT     *internal_obj,
+	ACPI_OPERAND_OBJECT     *internal_object,
 	u32                     *obj_length)
 {
 	ACPI_STATUS             status;
 
 
-	if ((VALID_DESCRIPTOR_TYPE (internal_obj, ACPI_DESC_TYPE_INTERNAL)) &&
-		(IS_THIS_OBJECT_TYPE (internal_obj, ACPI_TYPE_PACKAGE)))
+	if ((VALID_DESCRIPTOR_TYPE (internal_object, ACPI_DESC_TYPE_INTERNAL)) &&
+		(IS_THIS_OBJECT_TYPE (internal_object, ACPI_TYPE_PACKAGE)))
 	{
-		status =
-			acpi_cm_get_package_object_size (internal_obj, obj_length);
+		status = acpi_cm_get_package_object_size (internal_object, obj_length);
 	}
 
 	else {
-		status =
-			acpi_cm_get_simple_object_size (internal_obj, obj_length);
+		status = acpi_cm_get_simple_object_size (internal_object, obj_length);
 	}
 
 	return (status);
diff -urN linux-2.4.2-pre2/drivers/acpi/common/cmutils.c linux/drivers/acpi/common/cmutils.c
--- linux-2.4.2-pre2/drivers/acpi/common/cmutils.c	Mon Jan 22 13:23:42 2001
+++ linux/drivers/acpi/common/cmutils.c	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /*******************************************************************************
  *
  * Module Name: cmutils - common utility procedures
- *              $Revision: 23 $
+ *              $Revision: 27 $
  *
  ******************************************************************************/
 
@@ -340,6 +340,41 @@
 
 /*******************************************************************************
  *
+ * FUNCTION:    Acpi_cm_create_pkg_state_and_push
+ *
+ * PARAMETERS:  *Object         - Object to be added to the new state
+ *              Action          - Increment/Decrement
+ *              State_list      - List the state will be added to
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Create a new state and push it
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+acpi_cm_create_pkg_state_and_push (
+	void                    *internal_object,
+	void                    *external_object,
+	u16                     index,
+	ACPI_GENERIC_STATE      **state_list)
+{
+	ACPI_GENERIC_STATE       *state;
+
+
+	state = acpi_cm_create_pkg_state (internal_object, external_object, index);
+	if (!state) {
+		return (AE_NO_MEMORY);
+	}
+
+
+	acpi_cm_push_generic_state (state_list, state);
+	return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    Acpi_cm_push_generic_state
  *
  * PARAMETERS:  List_head           - Head of the state stack
@@ -500,6 +535,49 @@
 
 /*******************************************************************************
  *
+ * FUNCTION:    Acpi_cm_create_pkg_state
+ *
+ * PARAMETERS:  Object              - Initial Object to be installed in the
+ *                                    state
+ *              Action              - Update action to be performed
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Create an "Update State" - a flavor of the generic state used
+ *              to update reference counts and delete complex objects such
+ *              as packages.
+ *
+ ******************************************************************************/
+
+ACPI_GENERIC_STATE *
+acpi_cm_create_pkg_state (
+	void                    *internal_object,
+	void                    *external_object,
+	u16                     index)
+{
+	ACPI_GENERIC_STATE      *state;
+
+
+	/* Create the generic state object */
+
+	state = acpi_cm_create_generic_state ();
+	if (!state) {
+		return (NULL);
+	}
+
+	/* Init fields specific to the update struct */
+
+	state->pkg.source_object = (ACPI_OPERAND_OBJECT *) internal_object;
+	state->pkg.dest_object  = external_object;
+	state->pkg.index        = index;
+	state->pkg.num_packages = 1;
+
+	return (state);
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    Acpi_cm_create_control_state
  *
  * PARAMETERS:  None
@@ -632,16 +710,20 @@
 acpi_cm_resolve_package_references (
 	ACPI_OPERAND_OBJECT     *obj_desc)
 {
-	u32                 count;
-	ACPI_OPERAND_OBJECT *sub_object;
+	u32                     count;
+	ACPI_OPERAND_OBJECT     *sub_object;
+
 
 	if (obj_desc->common.type != ACPI_TYPE_PACKAGE) {
-		/* Must be a package */
+		/* The object must be a package */
 
 		REPORT_ERROR (("Must resolve Package Refs on a Package\n"));
 		return(AE_ERROR);
 	}
 
+	/*
+	 * TBD: what about nested packages? */
+
 	for (count = 0; count < obj_desc->package.count; count++) {
 		sub_object = obj_desc->package.elements[count];
 
@@ -667,6 +749,130 @@
 
 /*******************************************************************************
  *
+ * FUNCTION:    Acpi_cm_walk_package_tree
+ *
+ * PARAMETERS:  Obj_desc        - The Package object on which to resolve refs
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Walk through a package
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+acpi_cm_walk_package_tree (
+	ACPI_OPERAND_OBJECT     *source_object,
+	void                    *target_object,
+	ACPI_PKG_CALLBACK       walk_callback,
+	void                    *context)
+{
+	ACPI_STATUS             status = AE_OK;
+	ACPI_GENERIC_STATE      *state_list = NULL;
+	ACPI_GENERIC_STATE      *state;
+	u32                     this_index;
+	ACPI_OPERAND_OBJECT     *this_source_obj;
+
+
+	state = acpi_cm_create_pkg_state (source_object, target_object, 0);
+	if (!state) {
+		return (AE_NO_MEMORY);
+	}
+
+	while (state) {
+		this_index       = state->pkg.index;
+		this_source_obj  = (ACPI_OPERAND_OBJECT *)
+				   state->pkg.source_object->package.elements[this_index];
+
+		/*
+		 * Check for
+		 * 1) An uninitialized package element.  It is completely
+		 *      legal to declare a package and leave it uninitialized
+		 * 2) Not an internal object - can be a namespace node instead
+		 * 3) Any type other than a package.  Packages are handled in else case below.
+		 */
+		if ((!this_source_obj) ||
+			(!VALID_DESCRIPTOR_TYPE (
+					this_source_obj, ACPI_DESC_TYPE_INTERNAL)) ||
+			(!IS_THIS_OBJECT_TYPE (
+					this_source_obj, ACPI_TYPE_PACKAGE)))
+		{
+
+			status = walk_callback (0, this_source_obj, state, context);
+			if (ACPI_FAILURE (status)) {
+				/* TBD: must delete package created up to this point */
+
+				return (status);
+			}
+
+			state->pkg.index++;
+			while (state->pkg.index >= state->pkg.source_object->package.count) {
+				/*
+				 * We've handled all of the objects at this level,  This means
+				 * that we have just completed a package.  That package may
+				 * have contained one or more packages itself.
+				 *
+				 * Delete this state and pop the previous state (package).
+				 */
+				acpi_cm_delete_generic_state (state);
+				state = acpi_cm_pop_generic_state (&state_list);
+
+
+				/* Finished when there are no more states */
+
+				if (!state) {
+					/*
+					 * We have handled all of the objects in the top level
+					 * package just add the length of the package objects
+					 * and exit
+					 */
+					return (AE_OK);
+				}
+
+				/*
+				 * Go back up a level and move the index past the just
+				 * completed package object.
+				 */
+				state->pkg.index++;
+			}
+		}
+
+		else {
+			/* This is a sub-object of type package */
+
+			status = walk_callback (1, this_source_obj, state, context);
+			if (ACPI_FAILURE (status)) {
+				/* TBD: must delete package created up to this point */
+
+				return (status);
+			}
+
+
+			/*
+			 * The callback above returned a new target package object.
+			 */
+
+			/*
+			 * Push the current state and create a new one
+			 */
+			acpi_cm_push_generic_state (&state_list, state);
+			state = acpi_cm_create_pkg_state (this_source_obj, state->pkg.this_target_obj, 0);
+			if (!state) {
+				/* TBD: must delete package created up to this point */
+
+				return (AE_NO_MEMORY);
+			}
+		}
+	}
+
+	/* We should never get here */
+
+	return (AE_AML_INTERNAL);
+
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    _Report_error
  *
  * PARAMETERS:  Module_name         - Caller's module name (for error output)
@@ -676,7 +882,7 @@
  *
  * RETURN:      None
  *
- * DESCRIPTION: Print error message from KD table
+ * DESCRIPTION: Print error message
  *
  ******************************************************************************/
 
@@ -703,7 +909,7 @@
  *
  * RETURN:      None
  *
- * DESCRIPTION: Print warning message from KD table
+ * DESCRIPTION: Print warning message
  *
  ******************************************************************************/
 
@@ -729,7 +935,7 @@
  *
  * RETURN:      None
  *
- * DESCRIPTION: Print information message from KD table
+ * DESCRIPTION: Print information message
  *
  ******************************************************************************/
 
diff -urN linux-2.4.2-pre2/drivers/acpi/common/cmxface.c linux/drivers/acpi/common/cmxface.c
--- linux-2.4.2-pre2/drivers/acpi/common/cmxface.c	Mon Jan 29 10:15:58 2001
+++ linux/drivers/acpi/common/cmxface.c	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Module Name: cmxface - External interfaces for "global" ACPI functions
- *              $Revision: 62 $
+ *              $Revision: 64 $
  *
  *****************************************************************************/
 
@@ -158,8 +158,7 @@
 	if (!(flags & ACPI_NO_ACPI_ENABLE)) {
 		status = acpi_enable ();
 		if (ACPI_FAILURE (status)) {
-			/* TBD: workaround. Old Lions don't enable properly */
-			/*return (Status);*/
+			return (status);
 		}
 	}
 
@@ -180,12 +179,11 @@
 
 	/*
 	 * Initialize all device objects in the namespace
-	 * This runs the _STA, _INI, and _HID methods, and detects
-	 * the PCI root bus(es)
+	 * This runs the _STA and _INI methods.
 	 */
 
 	if (!(flags & ACPI_NO_DEVICE_INIT)) {
-		status = acpi_ns_initialize_devices (flags & ACPI_NO_PCI_INIT);
+		status = acpi_ns_initialize_devices ();
 		if (ACPI_FAILURE (status)) {
 			return (status);
 		}
@@ -193,7 +191,7 @@
 
 
 	/*
-	 * Initialize the objects that remain unitialized.  This
+	 * Initialize the objects that remain uninitialized.  This
 	 * runs the executable AML that is part of the declaration of Op_regions
 	 * and Fields.
 	 */
diff -urN linux-2.4.2-pre2/drivers/acpi/cpu.c linux/drivers/acpi/cpu.c
--- linux-2.4.2-pre2/drivers/acpi/cpu.c	Mon Jan 29 10:15:58 2001
+++ linux/drivers/acpi/cpu.c	Mon Dec  3 22:28:20 2001
@@ -2,6 +2,7 @@
  *  cpu.c - Processor handling
  *
  *  Copyright (C) 2000 Andrew Henroid
+ *  Copyright (C) 2001 Andrew Grover
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -28,27 +29,37 @@
 #define _COMPONENT	OS_DEPENDENT
 	MODULE_NAME	("cpu")
 
-unsigned long acpi_c2_exit_latency = ACPI_INFINITE;
-unsigned long acpi_c3_exit_latency = ACPI_INFINITE;
-unsigned long acpi_c2_enter_latency = ACPI_INFINITE;
-unsigned long acpi_c3_enter_latency = ACPI_INFINITE;
+u32 acpi_c2_exit_latency = ACPI_INFINITE;
+u32 acpi_c3_exit_latency = ACPI_INFINITE;
+u32 acpi_c2_enter_latency = ACPI_INFINITE;
+u32 acpi_c3_enter_latency = ACPI_INFINITE;
+u32 acpi_use_idle = TRUE;
+
+u32 acpi_c1_count = 0;
+u32 acpi_c2_count = 0;
+u32 acpi_c3_count = 0;
 
-static unsigned long acpi_pblk = ACPI_INVALID;
+static u32 acpi_pblk = ACPI_INVALID;
 static int acpi_c2_tested = 0;
 static int acpi_c3_tested = 0;
 static int acpi_max_c_state = 1;
-static int acpi_pm_tmr_len;
+static int acpi_pm_tmr_len = 24;
 
+#define CPU_POWER_STATES	3
 #define MAX_C2_LATENCY		100
 #define MAX_C3_LATENCY		1000
 
+#define ACPI_STATE_C1		0
+#define ACPI_STATE_C2		1
+#define ACPI_STATE_C3		2
+
 /*
  * Clear busmaster activity flag
  */
 static inline void
 acpi_clear_bm_activity(void)
 {
-	acpi_hw_register_bit_access(ACPI_WRITE, ACPI_MTX_LOCK, BM_STS, 0);
+	acpi_hw_register_bit_access(ACPI_WRITE, ACPI_MTX_LOCK, BM_STS, 1);
 }
 
 /*
@@ -100,6 +111,7 @@
 	}
 }
 
+
 /*
  * Idle loop (uniprocessor only)
  */
@@ -109,14 +121,9 @@
 	static int sleep_level = 1;
 	FADT_DESCRIPTOR *fadt = &acpi_fadt;
 
-	if (!fadt
-	    || (STRNCMP(fadt->header.signature, ACPI_FADT_SIGNATURE, ACPI_SIG_LEN) != 0)
-	    || !fadt->Xpm_tmr_blk.address
-	    || !acpi_pblk)
-		goto not_initialized;
-
 	/*
-	 * start from the previous sleep level..
+	 * start from the previous sleep level.
+	 * if not initialized, we goto sleep1
 	 */
 	if (sleep_level == 1
 	    || acpi_max_c_state < 2)
@@ -126,7 +133,7 @@
 	    || acpi_max_c_state < 3)
 		goto sleep2;
 
-      sleep3:
+sleep3:
 	sleep_level = 3;
 	if (!acpi_c3_tested) {
 		DEBUG_PRINT(ACPI_INFO, ("C3 works\n"));
@@ -147,6 +154,7 @@
 			goto sleep2;
 
 		time = acpi_read_pm_timer();
+		acpi_c3_count++;
 		inb(acpi_pblk + ACPI_P_LVL3);
 		/* Dummy read, force synchronization with the PMU */
 		acpi_read_pm_timer();
@@ -154,10 +162,10 @@
 
 		__sti();
 		if (diff < acpi_c3_exit_latency)
-			goto sleep2;
+			goto sleep1;
 	}
 
-      sleep3_with_arbiter:
+sleep3_with_arbiter:
 	for (;;) {
 		unsigned long time;
 		unsigned long diff;
@@ -172,6 +180,7 @@
 		
 		/* Disable arbiter, park on CPU */
 		acpi_hw_register_bit_access(ACPI_WRITE, ACPI_MTX_LOCK, ARB_DIS, 1);
+		acpi_c3_count++;
 		inb(acpi_pblk + ACPI_P_LVL3);
 		/* Dummy read, force synchronization with the PMU */
 		acpi_read_pm_timer();
@@ -181,10 +190,10 @@
 
 		__sti();
 		if (diff < acpi_c3_exit_latency)
-			goto sleep2;
+			goto sleep1;
 	}
 
-      sleep2:
+sleep2:
 	sleep_level = 2;
 	if (!acpi_c2_tested) {
 		DEBUG_PRINT(ACPI_INFO, ("C2 works\n"));
@@ -200,6 +209,7 @@
 			goto out;
 
 		time = acpi_read_pm_timer();
+		acpi_c2_count++;
 		inb(acpi_pblk + ACPI_P_LVL2);
 		/* Dummy read, force synchronization with the PMU */
 		acpi_read_pm_timer();
@@ -217,7 +227,7 @@
 			goto sleep3;
 	}
 
-      sleep1:
+sleep1:
 	sleep_level = 1;
 	acpi_sleep_on_busmaster();
 	for (;;) {
@@ -228,6 +238,7 @@
 		if (current->need_resched)
 			goto out;
 		time = acpi_read_pm_timer();
+		acpi_c1_count++;
 		safe_halt();
 		diff = acpi_compare_pm_timers(time, acpi_read_pm_timer());
 		if (diff > acpi_c2_enter_latency
@@ -235,15 +246,7 @@
 			goto sleep2;
 	}
 
-      not_initialized:
-	for (;;) {
-		__cli();
-		if (current->need_resched)
-			goto out;
-		safe_halt();
-	}
-
-      out:
+out:
 	__sti();
 }
 
@@ -278,17 +281,17 @@
 		acpi_c2_exit_latency
 			= ACPI_MICROSEC_TO_TMR_TICKS(acpi_fadt.plvl2_lat);
 		acpi_c2_enter_latency
-			= ACPI_MICROSEC_TO_TMR_TICKS(ACPI_TMR_HZ / 1000);
+			= ACPI_MICROSEC_TO_TMR_TICKS(acpi_fadt.plvl2_lat * 4);
 		acpi_max_c_state = 2;
 
 		printk(KERN_INFO "ACPI: System firmware supports: C2");
-	
+			
 		if (acpi_fadt.plvl3_lat
 		    && acpi_fadt.plvl3_lat <= MAX_C3_LATENCY) {
 			acpi_c3_exit_latency
 				= ACPI_MICROSEC_TO_TMR_TICKS(acpi_fadt.plvl3_lat);
 			acpi_c3_enter_latency
-				= ACPI_MICROSEC_TO_TMR_TICKS(acpi_fadt.plvl3_lat * 5);
+				= ACPI_MICROSEC_TO_TMR_TICKS(acpi_fadt.plvl3_lat * 12);
 			acpi_max_c_state = 3;
 
 			printk(" C3");
@@ -297,6 +300,10 @@
 		printk("\n");
 	}
 
+	printk(KERN_INFO "ACPI: plvl2lat=%d plvl3lat=%d\n", acpi_fadt.plvl2_lat, acpi_fadt.plvl3_lat);
+	printk(KERN_INFO "ACPI: C2 enter=%d C2 exit=%d\n", acpi_c2_enter_latency, acpi_c2_exit_latency);
+	printk(KERN_INFO "ACPI: C3 enter=%d C3 exit=%d\n", acpi_c3_enter_latency, acpi_c3_exit_latency);
+
 	return AE_OK;
 }
 
@@ -328,13 +335,19 @@
 
 	acpi_pm_timer_init();
 
-
+	if (acpi_use_idle) {
 #ifdef CONFIG_SMP
-	if (smp_num_cpus == 1)
-		pm_idle = acpi_idle;
+		if (smp_num_cpus == 1)
+			pm_idle = acpi_idle;
 #else
-	pm_idle = acpi_idle;
+		pm_idle = acpi_idle;
 #endif
+		printk(KERN_INFO "ACPI: Using ACPI idle\n");
+		printk(KERN_INFO "ACPI: If experiencing system slowness, try adding \"acpi=no-idle\" to cmdline\n");
+	}
+	else {
+		printk(KERN_INFO "ACPI: Not using ACPI idle\n");
+	}
 
 	return 0;
 }
diff -urN linux-2.4.2-pre2/drivers/acpi/dispatcher/dsobject.c linux/drivers/acpi/dispatcher/dsobject.c
--- linux-2.4.2-pre2/drivers/acpi/dispatcher/dsobject.c	Mon Jan 22 13:23:42 2001
+++ linux/drivers/acpi/dispatcher/dsobject.c	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Module Name: dsobject - Dispatcher object management routines
- *              $Revision: 56 $
+ *              $Revision: 57 $
  *
  *****************************************************************************/
 
@@ -101,6 +101,7 @@
 	case ACPI_TYPE_METHOD:
 
 		info->method_count++;
+
 
 		/*
 		 * Set the execution data width (32 or 64) based upon the
diff -urN linux-2.4.2-pre2/drivers/acpi/dispatcher/dsopcode.c linux/drivers/acpi/dispatcher/dsopcode.c
--- linux-2.4.2-pre2/drivers/acpi/dispatcher/dsopcode.c	Mon Jan 22 13:23:42 2001
+++ linux/drivers/acpi/dispatcher/dsopcode.c	Mon Dec  3 22:28:20 2001
@@ -2,7 +2,7 @@
  *
  * Module Name: dsopcode - Dispatcher Op Region support and handling of
  *                         "control" opcodes
- *              $Revision: 30 $
+ *              $Revision: 32 $
  *
  *****************************************************************************/
 
@@ -72,7 +72,6 @@
 
 	extra_desc = obj_desc->field_unit.extra;
 	node = obj_desc->field_unit.node;
-
 
 	/*
 	 * Allocate a new parser op to be the root of the parsed
diff -urN linux-2.4.2-pre2/drivers/acpi/driver.c linux/drivers/acpi/driver.c
--- linux-2.4.2-pre2/drivers/acpi/driver.c	Mon Jan 29 10:15:58 2001
+++ linux/drivers/acpi/driver.c	Mon Dec  3 22:28:20 2001
@@ -60,6 +60,8 @@
 
 static volatile int acpi_thread_pid = -1;
 
+static int acpi_start = 1;
+
 /************************************************/
 /* DECLARE_TASK_QUEUE is defined in             */
 /* /usr/src/linux/include/linux/tqueue.h        */
@@ -382,6 +384,19 @@
 	 &acpi_c3_enter_latency, sizeof(acpi_c3_enter_latency),
 	 0644, NULL, &acpi_do_ulong},
 
+	{ACPI_C1_COUNT, "c1_count",
+	 &acpi_c1_count, sizeof(acpi_c1_count),
+	 0644, NULL, &acpi_do_ulong},
+
+	{ACPI_C2_COUNT, "c2_count",
+	 &acpi_c2_count, sizeof(acpi_c2_count),
+	 0644, NULL, &acpi_do_ulong},
+
+	{ACPI_C3_COUNT, "c3_count",
+	 &acpi_c3_count, sizeof(acpi_c3_count),
+	 0644, NULL, &acpi_do_ulong},
+
+	
 /* until it actually works */
 /*	{ACPI_SLEEP, "sleep", NULL, 0, 0600, NULL, &acpi_do_sleep},*/
 
@@ -540,10 +555,16 @@
 int __init
 acpi_init(void)
 {
-	acpi_thread_pid = kernel_thread(acpi_thread,
+	if (acpi_start) {
+		acpi_thread_pid = kernel_thread(acpi_thread,
 					NULL,
 					(CLONE_FS | CLONE_FILES
 					 | CLONE_SIGHAND | SIGCHLD));
+	}
+	else {
+		printk(KERN_INFO "ACPI: Disabled\n");
+	}
+
 	return ((acpi_thread_pid >= 0) ? 0:-ENODEV);
 }
 
@@ -571,3 +592,21 @@
 
 module_init(acpi_init);
 module_exit(acpi_exit);
+
+#ifndef MODULE
+static int __init acpi_setup(char *str)
+{
+	while ((str != NULL) && (*str != '\0')) {
+		if (strncmp(str, "no-idle", 7) == 0)
+			acpi_use_idle = 0;
+		if (strncmp(str, "off", 3) == 0)
+			acpi_start = 0;
+		str = strchr(str, ',');
+		if (str != NULL)
+			str += strspn(str, ", \t");
+	}
+	return 1;
+}
+
+__setup("acpi=", acpi_setup);
+#endif
diff -urN linux-2.4.2-pre2/drivers/acpi/driver.h linux/drivers/acpi/driver.h
--- linux-2.4.2-pre2/drivers/acpi/driver.h	Fri Dec 29 14:07:21 2000
+++ linux/drivers/acpi/driver.h	Mon Dec  3 22:28:20 2001
@@ -37,10 +37,14 @@
 int acpi_cpu_init(void);
 u32 acpi_read_pm_timer(void);
 
-extern unsigned long acpi_c2_exit_latency;
-extern unsigned long acpi_c3_exit_latency;
-extern unsigned long acpi_c2_enter_latency;
-extern unsigned long acpi_c3_enter_latency;
+extern u32 acpi_c2_exit_latency;
+extern u32 acpi_c3_exit_latency;
+extern u32 acpi_c2_enter_latency;
+extern u32 acpi_c3_enter_latency;
+extern u32 acpi_use_idle;
+extern u32 acpi_c1_count;
+extern u32 acpi_c2_count;
+extern u32 acpi_c3_count;
 
 /*
  * driver.c
diff -urN linux-2.4.2-pre2/drivers/acpi/ec.c linux/drivers/acpi/ec.c
--- linux-2.4.2-pre2/drivers/acpi/ec.c	Mon Jan 29 10:15:58 2001
+++ linux/drivers/acpi/ec.c	Mon Dec  3 22:28:20 2001
@@ -554,7 +554,7 @@
 
 	ec_cxt->need_global_lock = obj.integer.value;
 
-	printk(KERN_INFO "ACPI: found EC @ (0x%02x,0x%02x,gpe %d GL %d)\n",
+	printk(KERN_INFO "ACPI: found EC @ (0x%02x,0x%02x,GPE %d GL %d)\n",
 		ec_cxt->data_port, ec_cxt->status_port, ec_cxt->gpe_bit,
 		ec_cxt->need_global_lock);
 
diff -urN linux-2.4.2-pre2/drivers/acpi/events/evevent.c linux/drivers/acpi/events/evevent.c
--- linux-2.4.2-pre2/drivers/acpi/events/evevent.c	Mon Jan 22 13:23:42 2001
+++ linux/drivers/acpi/events/evevent.c	Mon Dec  3 22:28:20 2001
@@ -2,7 +2,7 @@
  *
  * Module Name: evevent - Fixed and General Purpose Acpi_event
  *                          handling and dispatch
- *              $Revision: 33 $
+ *              $Revision: 34 $
  *
  *****************************************************************************/
 
@@ -55,7 +55,7 @@
 	ACPI_STATUS             status;
 
 
-	/* Make sure we've got ACPI tables */
+	/* Make sure we have ACPI tables */
 
 	if (!acpi_gbl_DSDT) {
 		return (AE_NO_ACPI_TABLES);
@@ -704,7 +704,7 @@
 acpi_ev_gpe_dispatch (
 	u32                     gpe_number)
 {
-		ACPI_GPE_LEVEL_INFO     gpe_info;
+	ACPI_GPE_LEVEL_INFO     gpe_info;
 
 	/*DEBUG_INCREMENT_EVENT_COUNT (EVENT_GENERAL);*/
 
@@ -720,59 +720,58 @@
 	 */
 	acpi_hw_disable_gpe (gpe_number);
 
-		gpe_info = acpi_gbl_gpe_info [gpe_number];
-
-		/*
-		 * Edge-Triggered?
-		 * ---------------
-		 * If edge-triggered, clear the GPE status bit now.  Note that
-		 * level-triggered events are cleared after the GPE is serviced.
-		 */
-		if (gpe_info.type & ACPI_EVENT_EDGE_TRIGGERED) {
-				acpi_hw_clear_gpe (gpe_number);
-		}
+	gpe_info = acpi_gbl_gpe_info [gpe_number];
 
+	/*
+	 * Edge-Triggered?
+	 * ---------------
+	 * If edge-triggered, clear the GPE status bit now.  Note that
+	 * level-triggered events are cleared after the GPE is serviced.
+	 */
+	if (gpe_info.type & ACPI_EVENT_EDGE_TRIGGERED) {
+		acpi_hw_clear_gpe (gpe_number);
+	}
 		/*
 		 * Function Handler (e.g. EC)?
 		 */
-		if (gpe_info.handler) {
-				/* Invoke function handler (at interrupt level). */
-				gpe_info.handler (gpe_info.context);
-
-				/* Level-Triggered? */
-				if (gpe_info.type & ACPI_EVENT_LEVEL_TRIGGERED) {
-						acpi_hw_clear_gpe (gpe_number);
-				}
-
-				/* Enable GPE */
-				acpi_hw_enable_gpe (gpe_number);
+	if (gpe_info.handler) {
+		/* Invoke function handler (at interrupt level). */
+		gpe_info.handler (gpe_info.context);
+
+		/* Level-Triggered? */
+		if (gpe_info.type & ACPI_EVENT_LEVEL_TRIGGERED) {
+			acpi_hw_clear_gpe (gpe_number);
 		}
-		/*
-		 * Method Handler (e.g. _Exx/_Lxx)?
-		 */
-		else if (gpe_info.method_handle) {
-				if (ACPI_FAILURE(acpi_os_queue_for_execution (OSD_PRIORITY_GPE,
+
+		/* Enable GPE */
+		acpi_hw_enable_gpe (gpe_number);
+	}
+	/*
+	 * Method Handler (e.g. _Exx/_Lxx)?
+	 */
+	else if (gpe_info.method_handle) {
+		if (ACPI_FAILURE(acpi_os_queue_for_execution (OSD_PRIORITY_GPE,
 			acpi_ev_asynch_execute_gpe_method, (void*)(NATIVE_UINT)gpe_number)))
-				{
-						/*
-						 * Shoudn't occur, but if it does report an error. Note that
-						 * the GPE will remain disabled until the ACPI Core Subsystem
-						 * is restarted, or the handler is removed/reinstalled.
-						 */
-						REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to queue handler for GPE bit [%X]\n", gpe_number));
-				}
+		{
+			/*
+			 * Shoudn't occur, but if it does report an error. Note that
+			 * the GPE will remain disabled until the ACPI Core Subsystem
+			 * is restarted, or the handler is removed/reinstalled.
+			 */
+			REPORT_ERROR (("Acpi_ev_gpe_dispatch: Unable to queue handler for GPE bit [%X]\n", gpe_number));
 		}
-		/*
-		 * No Handler? Report an error and leave the GPE disabled.
-		 */
-		else {
-				REPORT_ERROR (("Acpi_ev_gpe_dispatch: No installed handler for GPE [%X]\n", gpe_number));
+	}
+	/*
+	 * No Handler? Report an error and leave the GPE disabled.
+	 */
+	else {
+		REPORT_ERROR (("Acpi_ev_gpe_dispatch: No installed handler for GPE [%X]\n", gpe_number));
 
-				/* Level-Triggered? */
-				if (gpe_info.type & ACPI_EVENT_LEVEL_TRIGGERED) {
-						acpi_hw_clear_gpe (gpe_number);
-				}
+		/* Level-Triggered? */
+		if (gpe_info.type & ACPI_EVENT_LEVEL_TRIGGERED) {
+			acpi_hw_clear_gpe (gpe_number);
 		}
+	}
 
 	return (INTERRUPT_HANDLED);
 }
diff -urN linux-2.4.2-pre2/drivers/acpi/events/evregion.c linux/drivers/acpi/events/evregion.c
--- linux-2.4.2-pre2/drivers/acpi/events/evregion.c	Mon Jan 22 13:23:42 2001
+++ linux/drivers/acpi/events/evregion.c	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Module Name: evregion - ACPI Address_space (Op_region) handler dispatch
- *              $Revision: 94 $
+ *              $Revision: 96 $
  *
  *****************************************************************************/
 
diff -urN linux-2.4.2-pre2/drivers/acpi/hardware/hwsleep.c linux/drivers/acpi/hardware/hwsleep.c
--- linux-2.4.2-pre2/drivers/acpi/hardware/hwsleep.c	Mon Jan 29 10:15:58 2001
+++ linux/drivers/acpi/hardware/hwsleep.c	Mon Dec  3 22:28:20 2001
@@ -2,7 +2,7 @@
 /******************************************************************************
  *
  * Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface
- *              $Revision: 5 $
+ *              $Revision: 7 $
  *
  *****************************************************************************/
 
@@ -175,15 +175,14 @@
 	PM1_acontrol |= (type_a << acpi_hw_get_bit_shift (SLP_TYPE_X_MASK));
 	PM1_bcontrol |= (type_b << acpi_hw_get_bit_shift (SLP_TYPE_X_MASK));
 
-	/* the old version was disabling interrupts. let's try it without
-	 * and see how that works
-	 */
-	/*disable();*/
+	disable();
 
 	acpi_hw_register_write(ACPI_MTX_LOCK, PM1_a_CONTROL, PM1_acontrol);
 	acpi_hw_register_write(ACPI_MTX_LOCK, PM1_b_CONTROL, PM1_bcontrol);
+	acpi_hw_register_write(ACPI_MTX_LOCK, PM1_CONTROL,
+		(1 << acpi_hw_get_bit_shift (SLP_EN_MASK)));
 
-	/*enable();*/
+	enable();
 
 	return (AE_OK);
 }
diff -urN linux-2.4.2-pre2/drivers/acpi/hardware/hwtimer.c linux/drivers/acpi/hardware/hwtimer.c
--- linux-2.4.2-pre2/drivers/acpi/hardware/hwtimer.c	Mon Jan 29 10:15:58 2001
+++ linux/drivers/acpi/hardware/hwtimer.c	Mon Dec  3 22:28:20 2001
@@ -2,7 +2,7 @@
 /******************************************************************************
  *
  * Name: hwtimer.c - ACPI Power Management Timer Interface
- *              $Revision: 4 $
+ *              $Revision: 5 $
  *
  *****************************************************************************/
 
@@ -133,7 +133,7 @@
 	/*
 	 * Compute Tick Delta:
 	 * -------------------
-	 * Handle timer rollovers on 24- versus 32-bit timers.
+	 * Handle (max one) timer rollovers on 24- versus 32-bit timers.
 	 */
 	if (start_ticks < end_ticks) {
 		delta_ticks = end_ticks - start_ticks;
@@ -141,12 +141,16 @@
 	else if (start_ticks > end_ticks) {
 		/* 24-bit Timer */
 		if (0 == acpi_gbl_FADT->tmr_val_ext) {
-			delta_ticks = (0x00FFFFFF - start_ticks) + end_ticks;
+			delta_ticks = (((0x00FFFFFF - start_ticks) + end_ticks) & 0x00FFFFFF);
 		}
 		/* 32-bit Timer */
 		else {
 			delta_ticks = (0xFFFFFFFF - start_ticks) + end_ticks;
 		}
+	}
+	else {
+		*time_elapsed = 0;
+		return (AE_OK);
 	}
 
 	/*
diff -urN linux-2.4.2-pre2/drivers/acpi/include/accommon.h linux/drivers/acpi/include/accommon.h
--- linux-2.4.2-pre2/drivers/acpi/include/accommon.h	Mon Jan 29 10:15:59 2001
+++ linux/drivers/acpi/include/accommon.h	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Name: accommon.h -- prototypes for the common (subsystem-wide) procedures
- *       $Revision: 87 $
+ *       $Revision: 90 $
  *
  *****************************************************************************/
 
@@ -27,6 +27,30 @@
 #define _ACCOMMON_H
 
 
+typedef
+ACPI_STATUS (*ACPI_PKG_CALLBACK) (
+	u8                      object_type,
+	ACPI_OPERAND_OBJECT     *source_object,
+	ACPI_GENERIC_STATE      *state,
+	void                    *context);
+
+
+ACPI_STATUS
+acpi_cm_walk_package_tree (
+	ACPI_OPERAND_OBJECT     *source_object,
+	void                    *target_object,
+	ACPI_PKG_CALLBACK       walk_callback,
+	void                    *context);
+
+
+typedef struct acpi_pkg_info
+{
+	u8                      *free_space;
+	u32                     length;
+	u32                     object_space;
+	u32                     num_packages;
+} ACPI_PKG_INFO;
+
 #define REF_INCREMENT       (u16) 0
 #define REF_DECREMENT       (u16) 1
 #define REF_FORCE_DELETE    (u16) 2
@@ -194,29 +218,30 @@
 	u32                     *space_used);
 
 ACPI_STATUS
-acpi_cm_build_external_object (
+acpi_cm_copy_iobject_to_eobject (
 	ACPI_OPERAND_OBJECT     *obj,
 	ACPI_BUFFER             *ret_buffer);
 
 ACPI_STATUS
-acpi_cm_build_internal_simple_object(
+acpi_cm_copy_esimple_to_isimple(
 	ACPI_OBJECT             *user_obj,
 	ACPI_OPERAND_OBJECT     *obj);
 
 ACPI_STATUS
-acpi_cm_build_internal_object (
+acpi_cm_copy_eobject_to_iobject (
 	ACPI_OBJECT             *obj,
 	ACPI_OPERAND_OBJECT     *internal_obj);
 
 ACPI_STATUS
-acpi_cm_copy_internal_simple_object (
+acpi_cm_copy_isimple_to_isimple (
 	ACPI_OPERAND_OBJECT     *source_obj,
 	ACPI_OPERAND_OBJECT     *dest_obj);
 
 ACPI_STATUS
-acpi_cm_build_copy_internal_package_object (
+acpi_cm_copy_ipackage_to_ipackage (
 	ACPI_OPERAND_OBJECT     *source_obj,
-	ACPI_OPERAND_OBJECT     *dest_obj);
+	ACPI_OPERAND_OBJECT     *dest_obj,
+	ACPI_WALK_STATE         *walk_state);
 
 
 /*
@@ -526,12 +551,25 @@
 	ACPI_OPERAND_OBJECT     *object,
 	u16                     action);
 
+ACPI_GENERIC_STATE *
+acpi_cm_create_pkg_state (
+	void                    *internal_object,
+	void                    *external_object,
+	u16                     index);
+
 ACPI_STATUS
 acpi_cm_create_update_state_and_push (
 	ACPI_OPERAND_OBJECT     *object,
 	u16                     action,
 	ACPI_GENERIC_STATE      **state_list);
 
+ACPI_STATUS
+acpi_cm_create_pkg_state_and_push (
+	void                    *internal_object,
+	void                    *external_object,
+	u16                     index,
+	ACPI_GENERIC_STATE      **state_list);
+
 ACPI_GENERIC_STATE *
 acpi_cm_create_control_state (
 	void);
@@ -563,6 +601,15 @@
 ACPI_STATUS
 acpi_cm_resolve_package_references (
 	ACPI_OPERAND_OBJECT     *obj_desc);
+
+#ifdef ACPI_DEBUG
+
+void
+acpi_cm_display_init_pathname (
+	ACPI_HANDLE             obj_handle,
+	char                    *path);
+
+#endif
 
 
 /*
diff -urN linux-2.4.2-pre2/drivers/acpi/include/acconfig.h linux/drivers/acpi/include/acconfig.h
--- linux-2.4.2-pre2/drivers/acpi/include/acconfig.h	Mon Jan 29 10:15:59 2001
+++ linux/drivers/acpi/include/acconfig.h	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Name: acconfig.h - Global configuration constants
- *       $Revision: 53 $
+ *       $Revision: 55 $
  *
  *****************************************************************************/
 
@@ -53,7 +53,7 @@
 
 /* Version string */
 
-#define ACPI_CA_VERSION             0x20010125
+#define ACPI_CA_VERSION             0x20010208
 
 
 /* Maximum objects in the various object caches */
@@ -147,11 +147,6 @@
 #define LO_RSDP_WINDOW_SIZE         0x400
 #define HI_RSDP_WINDOW_SIZE         0x20000
 #define RSDP_SCAN_STEP              16
-
-
-/* Maximum nesting of package objects */
-
-#define MAX_PACKAGE_DEPTH           16
 
 
 #endif /* _ACCONFIG_H */
diff -urN linux-2.4.2-pre2/drivers/acpi/include/acdebug.h linux/drivers/acpi/include/acdebug.h
--- linux-2.4.2-pre2/drivers/acpi/include/acdebug.h	Mon Jan 22 13:23:42 2001
+++ linux/drivers/acpi/include/acdebug.h	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Name: acdebug.h - ACPI/AML debugger
- *       $Revision: 39 $
+ *       $Revision: 41 $
  *
  *****************************************************************************/
 
@@ -43,6 +43,7 @@
 extern u8                       opt_stats;
 extern u8                       opt_parse_jit;
 extern u8                       opt_verbose;
+extern u8                       opt_ini_methods;
 
 
 extern NATIVE_CHAR              *args[DB_MAX_ARGS];
@@ -196,6 +197,10 @@
 
 void
 acpi_db_find_references (
+	NATIVE_CHAR             *object_arg);
+
+void
+acpi_db_display_resources (
 	NATIVE_CHAR             *object_arg);
 
 
diff -urN linux-2.4.2-pre2/drivers/acpi/include/acgcc.h linux/drivers/acpi/include/acgcc.h
--- linux-2.4.2-pre2/drivers/acpi/include/acgcc.h	Mon Jan 22 13:23:42 2001
+++ linux/drivers/acpi/include/acgcc.h	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Name: acgcc.h - GCC specific defines, etc.
- *       $Revision: 4 $
+ *       $Revision: 5 $
  *
  *****************************************************************************/
 
@@ -26,12 +26,11 @@
 #ifndef __ACGCC_H__
 #define __ACGCC_H__
 
-#define COMPILER_DEPENDENT_UINT64   unsigned long long
-
 
 #ifdef __ia64__
 #define _IA64
 
+#define COMPILER_DEPENDENT_UINT64   unsigned long
 /* Single threaded */
 #define ACPI_APPLICATION
 
@@ -95,8 +94,7 @@
 
 
 #else /* DO IA32 */
-
-
+#define COMPILER_DEPENDENT_UINT64   unsigned long long
 #define ACPI_ASM_MACROS
 #define causeinterrupt(level)
 #define BREAKPOINT3
diff -urN linux-2.4.2-pre2/drivers/acpi/include/acinterp.h linux/drivers/acpi/include/acinterp.h
--- linux-2.4.2-pre2/drivers/acpi/include/acinterp.h	Mon Jan 29 10:15:59 2001
+++ linux/drivers/acpi/include/acinterp.h	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Name: acinterp.h - Interpreter subcomponent prototypes and defines
- *       $Revision: 91 $
+ *       $Revision: 92 $
  *
  *****************************************************************************/
 
@@ -557,12 +557,6 @@
 acpi_aml_unsigned_integer_to_string (
 	ACPI_INTEGER            value,
 	NATIVE_CHAR             *out_string);
-
-ACPI_STATUS
-acpi_aml_build_copy_internal_package_object (
-	ACPI_OPERAND_OBJECT     *source_obj,
-	ACPI_OPERAND_OBJECT     *dest_obj,
-	ACPI_WALK_STATE         *walk_state);
 
 
 /*
diff -urN linux-2.4.2-pre2/drivers/acpi/include/aclinux.h linux/drivers/acpi/include/aclinux.h
--- linux-2.4.2-pre2/drivers/acpi/include/aclinux.h	Wed Jan 24 15:28:36 2001
+++ linux/drivers/acpi/include/aclinux.h	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Name: aclinux.h - OS specific defines, etc.
- *       $Revision: 7 $
+ *       $Revision: 9 $
  *
  *****************************************************************************/
 
@@ -26,14 +26,15 @@
 #ifndef __ACLINUX_H__
 #define __ACLINUX_H__
 
-
 #define ACPI_OS_NAME                "Linux"
 
+#include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/ctype.h>
 #include <asm/system.h>
 #include <asm/atomic.h>
+#include <asm/div64.h>
 
 /* Linux uses GCC */
 
@@ -42,9 +43,14 @@
 #undef DEBUGGER_THREADING
 #define DEBUGGER_THREADING          DEBUGGER_SINGLE_THREADED
 
-/* Linux ia32 can't do int64 well */
 #ifndef _IA64
+/* Linux ia32 can't do int64 well */
 #define ACPI_NO_INTEGER64_SUPPORT
+/* And the ia32 kernel doesn't include 64-bit divide support */
+#define ACPI_DIV64(dividend, divisor) do_div(dividend, divisor)
+#else
+#define ACPI_DIV64(dividend, divisor) ACPI_DIVIDE(dividend, divisor)
 #endif
+
 
 #endif /* __ACLINUX_H__ */
diff -urN linux-2.4.2-pre2/drivers/acpi/include/aclocal.h linux/drivers/acpi/include/aclocal.h
--- linux-2.4.2-pre2/drivers/acpi/include/aclocal.h	Mon Jan 29 10:15:59 2001
+++ linux/drivers/acpi/include/aclocal.h	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Name: aclocal.h - Internal data types used across the ACPI subsystem
- *       $Revision: 100 $
+ *       $Revision: 104 $
  *
  *****************************************************************************/
 
@@ -368,6 +368,23 @@
 
 } ACPI_UPDATE_STATE;
 
+
+/*
+ * Pkg state - used to traverse nested package structures
+ */
+typedef struct acpi_pkg_state
+{
+	ACPI_STATE_COMMON
+	union acpi_operand_obj  *source_object;
+	union acpi_operand_obj  *dest_object;
+	struct acpi_walk_state  *walk_state;
+	void                    *this_target_obj;
+	u32                     num_packages;
+	u16                     index;
+
+} ACPI_PKG_STATE;
+
+
 /*
  * Control state - one per if/else and while constructs.
  * Allows nesting of these constructs
@@ -428,6 +445,7 @@
 	ACPI_UPDATE_STATE       update;
 	ACPI_SCOPE_STATE        scope;
 	ACPI_PSCOPE_STATE       parse_scope;
+	ACPI_PKG_STATE          pkg;
 	ACPI_RESULT_VALUES      results;
 
 } ACPI_GENERIC_STATE;
@@ -650,7 +668,6 @@
 
 typedef struct acpi_device_walk_info
 {
-	u32                     flags;
 	u16                     device_count;
 	u16                     num_STA;
 	u16                     num_INI;
diff -urN linux-2.4.2-pre2/drivers/acpi/include/acnamesp.h linux/drivers/acpi/include/acnamesp.h
--- linux-2.4.2-pre2/drivers/acpi/include/acnamesp.h	Mon Jan 22 13:23:42 2001
+++ linux/drivers/acpi/include/acnamesp.h	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Name: acnamesp.h - Namespace subcomponent prototypes and defines
- *       $Revision: 101 $
+ *       $Revision: 103 $
  *
  *****************************************************************************/
 
@@ -72,7 +72,7 @@
 
 ACPI_STATUS
 acpi_ns_initialize_devices (
-	u32                     flags);
+	void);
 
 
 /* Namespace init - nsxfinit */
@@ -316,6 +316,11 @@
 	NATIVE_CHAR             *pathname,
 	ACPI_NAMESPACE_NODE     *in_prefix_node,
 	ACPI_NAMESPACE_NODE     **out_node);
+
+u32
+acpi_ns_get_pathname_length (
+	ACPI_NAMESPACE_NODE     *node);
+
 
 /*
  * Object management for NTEs - nsobject
diff -urN linux-2.4.2-pre2/drivers/acpi/include/acoutput.h linux/drivers/acpi/include/acoutput.h
--- linux-2.4.2-pre2/drivers/acpi/include/acoutput.h	Mon Jan 29 10:15:59 2001
+++ linux/drivers/acpi/include/acoutput.h	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Name: acoutput.h -- debug output
- *       $Revision: 69 $
+ *       $Revision: 70 $
  *
  *****************************************************************************/
 
@@ -96,6 +96,7 @@
 #define TRACE_USER_REQUESTS         0x01000000
 #define TRACE_PACKAGE               0x02000000
 #define TRACE_MUTEX                 0x04000000
+#define TRACE_INIT                  0x08000000
 
 #define TRACE_ALL                   0x0FFFFF00
 
diff -urN linux-2.4.2-pre2/drivers/acpi/include/actypes.h linux/drivers/acpi/include/actypes.h
--- linux-2.4.2-pre2/drivers/acpi/include/actypes.h	Mon Jan 29 10:15:59 2001
+++ linux/drivers/acpi/include/actypes.h	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Name: actypes.h - Common data types for the entire ACPI subsystem
- *       $Revision: 163 $
+ *       $Revision: 165 $
  *
  *****************************************************************************/
 
@@ -237,8 +237,7 @@
 #define ACPI_NO_EVENT_INIT              0x04
 #define ACPI_NO_ACPI_ENABLE             0x08
 #define ACPI_NO_DEVICE_INIT             0x10
-#define ACPI_NO_PCI_INIT                0x20
-#define ACPI_NO_OBJECT_INIT             0x40
+#define ACPI_NO_OBJECT_INIT             0x20
 
 
 /*
@@ -1029,22 +1028,14 @@
  * END: Definitions for Resource Attributes
  */
 
-/*
- * Definitions for PCI Routing tables
- */
-typedef struct
-{
-	ACPI_INTEGER                address;
-	u32                         pin;
-	u32                         source_index;
-	NATIVE_CHAR                 source[1];
-
-} PRT_ENTRY;
 
-typedef struct _prt_tag
+typedef struct pci_routing_table
 {
 	u32                         length;
-	PRT_ENTRY                   data;
+	u32                         pin;
+	ACPI_INTEGER                address;        /* here for 64-bit alignment */
+	u32                         source_index;
+	NATIVE_CHAR                 source[4];      /* pad to 64 bits so sizeof() works in all cases */
 
 } PCI_ROUTING_TABLE;
 
diff -urN linux-2.4.2-pre2/drivers/acpi/interpreter/amfldio.c linux/drivers/acpi/interpreter/amfldio.c
--- linux-2.4.2-pre2/drivers/acpi/interpreter/amfldio.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/acpi/interpreter/amfldio.c	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Module Name: amfldio - Aml Field I/O
- *              $Revision: 37 $
+ *              $Revision: 39 $
  *
  *****************************************************************************/
 
@@ -416,7 +416,7 @@
 		/* Check if update rule needs to be applied (not if mask is all ones) */
 
 		/* The left shift drops the bits we want to ignore. */
-	  	if ((~mask << (sizeof(mask)*8 - bit_granularity)) != 0) {
+		if ((~mask << (sizeof(mask)*8 - bit_granularity)) != 0) {
 			/*
 			 * Read the current contents of the byte/word/dword containing
 			 * the field, and merge with the new field value.
diff -urN linux-2.4.2-pre2/drivers/acpi/interpreter/amstore.c linux/drivers/acpi/interpreter/amstore.c
--- linux-2.4.2-pre2/drivers/acpi/interpreter/amstore.c	Mon Jan 29 10:15:59 2001
+++ linux/drivers/acpi/interpreter/amstore.c	Mon Dec  3 22:28:20 2001
@@ -2,7 +2,7 @@
 /******************************************************************************
  *
  * Module Name: amstore - AML Interpreter object store support
- *              $Revision: 121 $
+ *              $Revision: 123 $
  *
  *****************************************************************************/
 
@@ -268,8 +268,7 @@
 				 * If the source is a package, copy the source to the new dest
 				 */
 				if (ACPI_TYPE_PACKAGE == obj_desc->common.type) {
-					status = acpi_aml_build_copy_internal_package_object (
-							 val_desc, obj_desc, walk_state);
+					status = acpi_cm_copy_ipackage_to_ipackage (val_desc, obj_desc, walk_state);
 					if (ACPI_FAILURE (status)) {
 						acpi_cm_remove_reference (obj_desc);
 						return (status);
diff -urN linux-2.4.2-pre2/drivers/acpi/interpreter/amstorob.c linux/drivers/acpi/interpreter/amstorob.c
--- linux-2.4.2-pre2/drivers/acpi/interpreter/amstorob.c	Mon Jan 29 10:15:59 2001
+++ linux/drivers/acpi/interpreter/amstorob.c	Mon Dec  3 22:28:20 2001
@@ -2,7 +2,7 @@
 /******************************************************************************
  *
  * Module Name: amstorob - AML Interpreter object store support, store to object
- *              $Revision: 22 $
+ *              $Revision: 23 $
  *
  *****************************************************************************/
 
@@ -66,6 +66,19 @@
 	length = source_desc->buffer.length;
 
 	/*
+	 * If target is a buffer of length zero, allocate a new
+	 * buffer of the proper length
+	 */
+	if (target_desc->buffer.length == 0) {
+		target_desc->buffer.pointer = acpi_cm_allocate (length);
+		if (!target_desc->buffer.pointer) {
+			return (AE_NO_MEMORY);
+		}
+
+		target_desc->buffer.length = length;
+	}
+
+	/*
 	 * Buffer is a static allocation,
 	 * only place what will fit in the buffer.
 	 */
@@ -141,11 +154,11 @@
 		}
 
 		target_desc->string.pointer = acpi_cm_allocate (length + 1);
-		target_desc->string.length = length;
-
 		if (!target_desc->string.pointer) {
 			return (AE_NO_MEMORY);
 		}
+		target_desc->string.length = length;
+
 
 		MEMCPY(target_desc->string.pointer, buffer, length);
 	}
diff -urN linux-2.4.2-pre2/drivers/acpi/interpreter/amutils.c linux/drivers/acpi/interpreter/amutils.c
--- linux-2.4.2-pre2/drivers/acpi/interpreter/amutils.c	Mon Jan 22 13:23:42 2001
+++ linux/drivers/acpi/interpreter/amutils.c	Mon Dec  3 22:28:20 2001
@@ -2,7 +2,7 @@
 /******************************************************************************
  *
  * Module Name: amutils - interpreter/scanner utilities
- *              $Revision: 68 $
+ *              $Revision: 69 $
  *
  *****************************************************************************/
 
@@ -36,21 +36,6 @@
 	 MODULE_NAME         ("amutils")
 
 
-typedef struct internal_search_st
-{
-	ACPI_OPERAND_OBJECT         *dest_obj;
-	u32                         index;
-	ACPI_OPERAND_OBJECT         *source_obj;
-
-} INTERNAL_PKG_SEARCH_INFO;
-
-
-/* Used to traverse nested packages when copying*/
-/* TBD: This must be removed! */
-
-INTERNAL_PKG_SEARCH_INFO        copy_level[MAX_PACKAGE_DEPTH];
-
-
 /*******************************************************************************
  *
  * FUNCTION:    Acpi_aml_enter_interpreter
@@ -380,156 +365,6 @@
 	}
 
 	return (AE_OK);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    Acpi_aml_build_copy_internal_package_object
- *
- * PARAMETERS:  *Source_obj     - Pointer to the source package object
- *              *Dest_obj       - Where the internal object is returned
- *
- * RETURN:      Status          - the status of the call
- *
- * DESCRIPTION: This function is called to copy an internal package object
- *              into another internal package object.
- *
- ******************************************************************************/
-
-ACPI_STATUS
-acpi_aml_build_copy_internal_package_object (
-	ACPI_OPERAND_OBJECT     *source_obj,
-	ACPI_OPERAND_OBJECT     *dest_obj,
-	ACPI_WALK_STATE         *walk_state)
-{
-	u32                         current_depth = 0;
-	ACPI_STATUS                 status = AE_OK;
-	u32                         length = 0;
-	u32                         this_index;
-	u32                         object_space = 0;
-	ACPI_OPERAND_OBJECT         *this_dest_obj;
-	ACPI_OPERAND_OBJECT         *this_source_obj;
-	INTERNAL_PKG_SEARCH_INFO    *level_ptr;
-
-
-	/*
-	 * Initialize the working variables
-	 */
-
-	MEMSET ((void *) copy_level, 0, sizeof(copy_level));
-
-	copy_level[0].dest_obj  = dest_obj;
-	copy_level[0].source_obj = source_obj;
-	level_ptr               = &copy_level[0];
-	current_depth           = 0;
-
-	dest_obj->common.type   = source_obj->common.type;
-	dest_obj->package.count = source_obj->package.count;
-
-
-	/*
-	 * Build an array of ACPI_OBJECTS in the buffer
-	 * and move the free space past it
-	 */
-
-	dest_obj->package.elements  = acpi_cm_callocate (
-			 (dest_obj->package.count + 1) *
-			 sizeof (void *));
-	if (!dest_obj->package.elements) {
-		/* Package vector allocation failure   */
-
-		REPORT_ERROR (("Aml_build_copy_internal_package_object: Package vector allocation failure\n"));
-		return (AE_NO_MEMORY);
-	}
-
-	dest_obj->package.next_element = dest_obj->package.elements;
-
-
-	while (1) {
-		this_index      = level_ptr->index;
-		this_dest_obj   = (ACPI_OPERAND_OBJECT *) level_ptr->dest_obj->package.elements[this_index];
-		this_source_obj = (ACPI_OPERAND_OBJECT *) level_ptr->source_obj->package.elements[this_index];
-
-		if (IS_THIS_OBJECT_TYPE (this_source_obj, ACPI_TYPE_PACKAGE)) {
-			/*
-			 * If this object is a package then we go one deeper
-			 */
-			if (current_depth >= MAX_PACKAGE_DEPTH-1) {
-				/*
-				 * Too many nested levels of packages for us to handle
-				 */
-				return (AE_LIMIT);
-			}
-
-			/*
-			 * Build the package object
-			 */
-			this_dest_obj = acpi_cm_create_internal_object (ACPI_TYPE_PACKAGE);
-			level_ptr->dest_obj->package.elements[this_index] = this_dest_obj;
-
-
-			this_dest_obj->common.type      = ACPI_TYPE_PACKAGE;
-			this_dest_obj->package.count    = this_dest_obj->package.count;
-
-			/*
-			 * Save space for the array of objects (Package elements)
-			 * update the buffer length counter
-			 */
-			object_space            = this_dest_obj->package.count *
-					  sizeof (ACPI_OPERAND_OBJECT);
-			length                  += object_space;
-			current_depth++;
-			level_ptr               = &copy_level[current_depth];
-			level_ptr->dest_obj     = this_dest_obj;
-			level_ptr->source_obj   = this_source_obj;
-			level_ptr->index        = 0;
-
-		}   /* if object is a package */
-
-		else {
-
-			this_dest_obj = acpi_cm_create_internal_object (
-					   this_source_obj->common.type);
-			level_ptr->dest_obj->package.elements[this_index] = this_dest_obj;
-
-			status = acpi_aml_store_object_to_object(this_source_obj, this_dest_obj, walk_state);
-
-			if (ACPI_FAILURE (status)) {
-				/*
-				 * Failure get out
-				 */
-				return (status);
-			}
-
-			length      +=object_space;
-
-			level_ptr->index++;
-			while (level_ptr->index >= level_ptr->dest_obj->package.count) {
-				/*
-				 * We've handled all of the objects at this level,  This means
-				 * that we have just completed a package.  That package may
-				 * have contained one or more packages itself
-				 */
-				if (current_depth == 0) {
-					/*
-					 * We have handled all of the objects in the top level
-					 * package just add the length of the package objects
-					 * and exit
-					 */
-					return (AE_OK);
-				}
-
-				/*
-				 * Go back up a level and move the index past the just
-				 * completed package object.
-				 */
-				current_depth--;
-				level_ptr = &copy_level[current_depth];
-				level_ptr->index++;
-			}
-		}   /* else object is NOT a package */
-	}   /* while (1)  */
 }
 
 
diff -urN linux-2.4.2-pre2/drivers/acpi/namespace/nseval.c linux/drivers/acpi/namespace/nseval.c
--- linux-2.4.2-pre2/drivers/acpi/namespace/nseval.c	Mon Jan 22 13:23:43 2001
+++ linux/drivers/acpi/namespace/nseval.c	Mon Dec  3 22:28:20 2001
@@ -2,7 +2,7 @@
  *
  * Module Name: nseval - Object evaluation interfaces -- includes control
  *                       method lookup and execution.
- *              $Revision: 81 $
+ *              $Revision: 83 $
  *
  ******************************************************************************/
 
@@ -253,8 +253,8 @@
 
 	node = acpi_ns_convert_handle_to_entry (handle);
 	if (!node) {
-		status = AE_BAD_PARAMETER;
-		goto unlock_and_exit;
+		acpi_cm_release_mutex (ACPI_MTX_NAMESPACE);
+		return (AE_BAD_PARAMETER);
 	}
 
 
@@ -316,12 +316,6 @@
 	 * so we just return
 	 */
 	return (status);
-
-
-unlock_and_exit:
-
-	acpi_cm_release_mutex (ACPI_MTX_NAMESPACE);
-	return (status);
 }
 
 
@@ -354,14 +348,6 @@
 	ACPI_OPERAND_OBJECT     *obj_desc;
 
 
-	/* Verify that there is a method associated with this object */
-
-	obj_desc = acpi_ns_get_attached_object ((ACPI_HANDLE) method_node);
-	if (!obj_desc) {
-		return (AE_ERROR);
-	}
-
-
 	/*
 	 * Unlock the namespace before execution.  This allows namespace access
 	 * via the external Acpi* interfaces while a method is being executed.
@@ -372,8 +358,16 @@
 
 	acpi_cm_release_mutex (ACPI_MTX_NAMESPACE);
 
+	/* Verify that there is a method associated with this object */
+
+	obj_desc = acpi_ns_get_attached_object ((ACPI_HANDLE) method_node);
+	if (!obj_desc) {
+		return (AE_ERROR);
+	}
+
+
 	/*
-	 * Excecute the method via the interpreter
+	 * Execute the method via the interpreter
 	 */
 	status = acpi_aml_execute_method (method_node, params, return_obj_desc);
 
diff -urN linux-2.4.2-pre2/drivers/acpi/namespace/nsinit.c linux/drivers/acpi/namespace/nsinit.c
--- linux-2.4.2-pre2/drivers/acpi/namespace/nsinit.c	Mon Jan 22 13:23:43 2001
+++ linux/drivers/acpi/namespace/nsinit.c	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Module Name: nsinit - namespace initialization
- *              $Revision: 12 $
+ *              $Revision: 15 $
  *
  *****************************************************************************/
 
@@ -89,13 +89,12 @@
 
 ACPI_STATUS
 acpi_ns_initialize_devices (
-	u32                     flags)
+	void)
 {
 	ACPI_STATUS             status;
 	ACPI_DEVICE_WALK_INFO   info;
 
 
-	info.flags = flags;
 	info.device_count = 0;
 	info.num_STA = 0;
 	info.num_INI = 0;
@@ -168,6 +167,7 @@
 		info->op_region_init++;
 		status = acpi_ds_get_region_arguments (obj_desc);
 
+
 		break;
 
 
@@ -180,6 +180,8 @@
 
 		info->field_init++;
 		status = acpi_ds_get_field_unit_arguments (obj_desc);
+
+
 		break;
 
 	default:
@@ -198,7 +200,7 @@
  *
  * FUNCTION:    Acpi_ns_init_one_device
  *
- * PARAMETERS:  The usual "I'm a namespace callback" stuff
+ * PARAMETERS:  WALK_CALLBACK
  *
  * RETURN:      ACPI_STATUS
  *
@@ -221,6 +223,7 @@
 	ACPI_DEVICE_WALK_INFO  *info = (ACPI_DEVICE_WALK_INFO *) context;
 
 
+
 	info->device_count++;
 
 	acpi_cm_acquire_mutex (ACPI_MTX_NAMESPACE);
@@ -250,6 +253,7 @@
 		/* don't look at children of a not present device */
 		return(AE_CTRL_DEPTH);
 	}
+
 
 	/*
 	 * The device is present. Run _INI.
diff -urN linux-2.4.2-pre2/drivers/acpi/namespace/nsnames.c linux/drivers/acpi/namespace/nsnames.c
--- linux-2.4.2-pre2/drivers/acpi/namespace/nsnames.c	Mon Jan 22 13:23:43 2001
+++ linux/drivers/acpi/namespace/nsnames.c	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /*******************************************************************************
  *
  * Module Name: nsnames - Name manipulation and search
- *              $Revision: 53 $
+ *              $Revision: 54 $
  *
  ******************************************************************************/
 
@@ -115,6 +115,46 @@
 
 /*******************************************************************************
  *
+ * FUNCTION:    Acpi_ns_get_pathname_length
+ *
+ * PARAMETERS:  Node        - Namespace node
+ *
+ * RETURN:      Length of path, including prefix
+ *
+ * DESCRIPTION: Get the length of the pathname string for this node
+ *
+ ******************************************************************************/
+
+u32
+acpi_ns_get_pathname_length (
+	ACPI_NAMESPACE_NODE     *node)
+{
+	u32                     size;
+	ACPI_NAMESPACE_NODE     *next_node;
+
+	/*
+	 * Compute length of pathname as 5 * number of name segments.
+	 * Go back up the parent tree to the root
+	 */
+	for (size = 0, next_node = node;
+		  acpi_ns_get_parent_object (next_node);
+		  next_node = acpi_ns_get_parent_object (next_node))
+	{
+		size += PATH_SEGMENT_LENGTH;
+	}
+
+	/* Special case for size still 0 - no parent for "special" nodes */
+
+	if (!size) {
+		size = PATH_SEGMENT_LENGTH;
+	}
+
+	return (size + 1);
+}
+
+
+/*******************************************************************************
+ *
  * FUNCTION:    Acpi_ns_handle_to_pathname
  *
  * PARAMETERS:  Target_handle           - Handle of named object whose name is
@@ -138,11 +178,10 @@
 {
 	ACPI_STATUS             status = AE_OK;
 	ACPI_NAMESPACE_NODE     *node;
-	ACPI_NAMESPACE_NODE     *next_node;
 	u32                     path_length;
-	u32                     size;
 	u32                     user_buf_size;
 	ACPI_NAME               name;
+	u32                     size;
 
 
 	if (!acpi_gbl_root_node || !target_handle) {
@@ -159,26 +198,12 @@
 		return (AE_BAD_PARAMETER);
 	}
 
-	/*
-	 * Compute length of pathname as 5 * number of name segments.
-	 * Go back up the parent tree to the root
-	 */
-	for (size = 0, next_node = node;
-		  acpi_ns_get_parent_object (next_node);
-		  next_node = acpi_ns_get_parent_object (next_node))
-	{
-		size += PATH_SEGMENT_LENGTH;
-	}
-
-	/* Special case for size still 0 - no parent for "special" nodes */
-
-	if (!size) {
-		size = PATH_SEGMENT_LENGTH;
-	}
 
 	/* Set return length to the required path length */
 
-	path_length = size + 1;
+	path_length = acpi_ns_get_pathname_length (node);
+	size = path_length - 1;
+
 	user_buf_size = *buf_size;
 	*buf_size = path_length;
 
diff -urN linux-2.4.2-pre2/drivers/acpi/namespace/nsxfobj.c linux/drivers/acpi/namespace/nsxfobj.c
--- linux-2.4.2-pre2/drivers/acpi/namespace/nsxfobj.c	Mon Jan 22 13:23:43 2001
+++ linux/drivers/acpi/namespace/nsxfobj.c	Mon Dec  3 22:28:20 2001
@@ -2,7 +2,7 @@
  *
  * Module Name: nsxfobj - Public interfaces to the ACPI subsystem
  *                         ACPI Object oriented interfaces
- *              $Revision: 78 $
+ *              $Revision: 80 $
  *
  ******************************************************************************/
 
@@ -117,9 +117,8 @@
 		 * internal object
 		 */
 		for (i = 0; i < count; i++) {
-			status =
-				acpi_cm_build_internal_object (&param_objects->pointer[i],
-						  param_ptr[i]);
+			status = acpi_cm_copy_eobject_to_iobject (&param_objects->pointer[i],
+					 param_ptr[i]);
 
 			if (ACPI_FAILURE (status)) {
 				acpi_cm_delete_internal_object_list (param_ptr);
@@ -236,7 +235,7 @@
 						/*
 						 *  We have enough space for the object, build it
 						 */
-						status = acpi_cm_build_external_object (return_obj,
+						status = acpi_cm_copy_iobject_to_eobject (return_obj,
 								  return_buffer);
 						return_buffer->length = buffer_space_needed;
 					}
@@ -580,12 +579,12 @@
 	acpi_cm_acquire_mutex (ACPI_MTX_NAMESPACE);
 
 	node = acpi_ns_convert_handle_to_entry (obj_handle);
+
+	acpi_cm_release_mutex (ACPI_MTX_NAMESPACE);
+
 	if (!node) {
-		acpi_cm_release_mutex (ACPI_MTX_NAMESPACE);
 		return (AE_BAD_PARAMETER);
 	}
-
-	acpi_cm_release_mutex (ACPI_MTX_NAMESPACE);
 
 	/*
 	 * Run _STA to determine if device is present
diff -urN linux-2.4.2-pre2/drivers/acpi/resources/rscalc.c linux/drivers/acpi/resources/rscalc.c
--- linux-2.4.2-pre2/drivers/acpi/resources/rscalc.c	Mon Jan 22 13:23:43 2001
+++ linux/drivers/acpi/resources/rscalc.c	Mon Dec  3 22:28:20 2001
@@ -2,7 +2,7 @@
  *
  * Module Name: rscalc - Acpi_rs_calculate_byte_stream_length
  *                       Acpi_rs_calculate_list_length
- *              $Revision: 18 $
+ *              $Revision: 21 $
  *
  ******************************************************************************/
 
@@ -27,6 +27,8 @@
 
 #include "acpi.h"
 #include "acresrc.h"
+#include "amlcode.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          RESOURCE_MANAGER
 	 MODULE_NAME         ("rscalc")
@@ -704,6 +706,7 @@
 				 */
 				bytes_consumed = 2;
 				structure_size = RESOURCE_LENGTH;
+				byte_stream_buffer_length = bytes_parsed;
 				break;
 
 
@@ -810,7 +813,10 @@
 		name_found = FALSE;
 
 		for (table_index = 0; table_index < 4 && !name_found; table_index++) {
-			if (ACPI_TYPE_STRING == (*sub_object_list)->common.type) {
+			if ((ACPI_TYPE_STRING == (*sub_object_list)->common.type) ||
+				((INTERNAL_TYPE_REFERENCE == (*sub_object_list)->common.type) &&
+					((*sub_object_list)->reference.op_code == AML_NAMEPATH_OP)))
+			{
 				name_found = TRUE;
 			}
 
@@ -822,17 +828,22 @@
 			}
 		}
 
-		temp_size_needed += (sizeof (PCI_ROUTING_TABLE) - 1);
+		temp_size_needed += (sizeof (PCI_ROUTING_TABLE) - 4);
 
 		/*
 		 * Was a String type found?
 		 */
 		if (TRUE == name_found) {
-			/*
-			 * The length String.Length field includes the
-			 * terminating NULL
-			 */
-			temp_size_needed += (*sub_object_list)->string.length;
+			if (ACPI_TYPE_STRING == (*sub_object_list)->common.type) {
+				/*
+				 * The length String.Length field includes the
+				 * terminating NULL
+				 */
+				temp_size_needed += (*sub_object_list)->string.length;
+			}
+			else {
+				temp_size_needed += acpi_ns_get_pathname_length ((*sub_object_list)->reference.node);
+			}
 		}
 
 		else {
@@ -855,7 +866,7 @@
 	}
 
 
-	*buffer_size_needed = temp_size_needed + sizeof (PCI_ROUTING_TABLE);
+	*buffer_size_needed = temp_size_needed;
 
 	return (AE_OK);
 }
diff -urN linux-2.4.2-pre2/drivers/acpi/resources/rscreate.c linux/drivers/acpi/resources/rscreate.c
--- linux-2.4.2-pre2/drivers/acpi/resources/rscreate.c	Mon Jan 22 13:23:43 2001
+++ linux/drivers/acpi/resources/rscreate.c	Mon Dec  3 22:28:20 2001
@@ -3,7 +3,7 @@
  * Module Name: rscreate - Acpi_rs_create_resource_list
  *                         Acpi_rs_create_pci_routing_table
  *                         Acpi_rs_create_byte_stream
- *              $Revision: 24 $
+ *              $Revision: 25 $
  *
  ******************************************************************************/
 
@@ -28,6 +28,8 @@
 
 #include "acpi.h"
 #include "acresrc.h"
+#include "amlcode.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          RESOURCE_MANAGER
 	 MODULE_NAME         ("rscreate")
@@ -157,6 +159,7 @@
 	u32                     number_of_elements = 0;
 	u32                     index = 0;
 	PCI_ROUTING_TABLE       *user_prt = NULL;
+	ACPI_NAMESPACE_NODE     *node;
 	ACPI_STATUS             status;
 
 
@@ -203,10 +206,10 @@
 			/*
 			 * Fill in the Length field with the information we
 			 * have at this point.
-			 * The minus one is to subtract the size of the
-			 * u8 Source[1] member because it is added below.
+			 * The minus four is to subtract the size of the
+			 * u8 Source[4] member because it is added below.
 			 */
-			user_prt->length = (sizeof (PCI_ROUTING_TABLE) - 1);
+			user_prt->length = (sizeof (PCI_ROUTING_TABLE) -4);
 
 			/*
 			 * Dereference the sub-package
@@ -221,11 +224,10 @@
 			sub_object_list = package_element->package.elements;
 
 			/*
-			 * Dereference the Address
+			 * 1) First subobject:  Dereference the Address
 			 */
 			if (ACPI_TYPE_INTEGER == (*sub_object_list)->common.type) {
-				user_prt->data.address =
-						(*sub_object_list)->integer.value;
+				user_prt->address = (*sub_object_list)->integer.value;
 			}
 
 			else {
@@ -233,12 +235,12 @@
 			}
 
 			/*
-			 * Dereference the Pin
+			 * 2) Second subobject: Dereference the Pin
 			 */
 			sub_object_list++;
 
 			if (ACPI_TYPE_INTEGER == (*sub_object_list)->common.type) {
-				user_prt->data.pin =
+				user_prt->pin =
 						(u32) (*sub_object_list)->integer.value;
 			}
 
@@ -247,37 +249,57 @@
 			}
 
 			/*
-			 * Dereference the Source Name
+			 * 3) Third subobject: Dereference the Source Name
 			 */
 			sub_object_list++;
 
-			if (ACPI_TYPE_STRING == (*sub_object_list)->common.type) {
-				STRCPY (user_prt->data.source,
+			switch ((*sub_object_list)->common.type)
+			{
+			case INTERNAL_TYPE_REFERENCE:
+				if ((*sub_object_list)->reference.op_code != AML_NAMEPATH_OP) {
+					return (AE_BAD_DATA);
+				}
+
+				node = (*sub_object_list)->reference.node;
+
+				/* TBD: use *remaining* length of the buffer! */
+
+				status = acpi_ns_handle_to_pathname ((ACPI_HANDLE *) node,
+						 output_buffer_length, user_prt->source);
+
+				user_prt->length += STRLEN (user_prt->source) + 1; /* include null terminator */
+				break;
+
+
+			case ACPI_TYPE_STRING:
+
+				STRCPY (user_prt->source,
 					  (*sub_object_list)->string.pointer);
 
 				/*
 				 * Add to the Length field the length of the string
 				 */
 				user_prt->length += (*sub_object_list)->string.length;
-			}
+				break;
 
-			else {
+
+			case ACPI_TYPE_INTEGER:
 				/*
 				 * If this is a number, then the Source Name
 				 * is NULL, since the entire buffer was zeroed
 				 * out, we can leave this alone.
 				 */
-				if (ACPI_TYPE_INTEGER == (*sub_object_list)->common.type) {
-					/*
-					 * Add to the Length field the length of
-					 * the u32 NULL
-					 */
-					user_prt->length += sizeof (u32);
-				}
+				/*
+				 * Add to the Length field the length of
+				 * the u32 NULL
+				 */
+				user_prt->length += sizeof (u32);
+				break;
 
-				else {
-					return (AE_BAD_DATA);
-				}
+
+			default:
+			   return (AE_BAD_DATA);
+			   break;
 			}
 
 			/* Now align the current length */
@@ -285,12 +307,12 @@
 			user_prt->length = ROUND_UP_TO_64_bITS (user_prt->length);
 
 			/*
-			 * Dereference the Source Index
+			 * 4) Fourth subobject: Dereference the Source Index
 			 */
 			sub_object_list++;
 
 			if (ACPI_TYPE_INTEGER == (*sub_object_list)->common.type) {
-				user_prt->data.source_index =
+				user_prt->source_index =
 						(u32) (*sub_object_list)->integer.value;
 			}
 
diff -urN linux-2.4.2-pre2/drivers/acpi/resources/rsdump.c linux/drivers/acpi/resources/rsdump.c
--- linux-2.4.2-pre2/drivers/acpi/resources/rsdump.c	Mon Jan 22 13:23:43 2001
+++ linux/drivers/acpi/resources/rsdump.c	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /*******************************************************************************
  *
  * Module Name: rsdump - Functions do dump out the resource structures.
- *              $Revision: 15 $
+ *              $Revision: 16 $
  *
  ******************************************************************************/
 
@@ -910,24 +910,24 @@
 
 
 	if (acpi_dbg_level & TRACE_RESOURCES && _COMPONENT & acpi_dbg_layer) {
-		prt_element = (PCI_ROUTING_TABLE *)buffer;
+		prt_element = (PCI_ROUTING_TABLE *) buffer;
 
 		while (!done) {
 			acpi_os_printf ("\t_pCI IRQ Routing Table structure %X.\n", count++);
 
 			acpi_os_printf ("\t\t_address: %X\n",
-					 prt_element->data.address);
+					 prt_element->address);
 
-			acpi_os_printf ("\t\t_pin: %X\n", prt_element->data.pin);
+			acpi_os_printf ("\t\t_pin: %X\n", prt_element->pin);
 
-			acpi_os_printf ("\t\t_source: %s\n", prt_element->data.source);
+			acpi_os_printf ("\t\t_source: %s\n", prt_element->source);
 
 			acpi_os_printf ("\t\t_source_index: %X\n",
-					 prt_element->data.source_index);
+					 prt_element->source_index);
 
 			buffer += prt_element->length;
 
-			prt_element = (PCI_ROUTING_TABLE *)buffer;
+			prt_element = (PCI_ROUTING_TABLE *) buffer;
 
 			if(0 == prt_element->length) {
 				done = TRUE;
diff -urN linux-2.4.2-pre2/drivers/acpi/resources/rslist.c linux/drivers/acpi/resources/rslist.c
--- linux-2.4.2-pre2/drivers/acpi/resources/rslist.c	Mon Jan 22 13:23:43 2001
+++ linux/drivers/acpi/resources/rslist.c	Mon Dec  3 22:28:20 2001
@@ -2,7 +2,7 @@
  *
  * Module Name: rslist - Acpi_rs_byte_stream_to_list
  *                       Acpi_list_to_byte_stream
- *              $Revision: 10 $
+ *              $Revision: 11 $
  *
  ******************************************************************************/
 
@@ -302,9 +302,7 @@
 	/*
 	 * Check the reason for exiting the while loop
 	 */
-	if (!(byte_stream_buffer_length == bytes_parsed) ||
-		 (TRUE != end_tag_processed))
-	{
+	if (TRUE != end_tag_processed) {
 		return (AE_AML_ERROR);
 	}
 
diff -urN linux-2.4.2-pre2/drivers/acpi/tables/tbconvrt.c linux/drivers/acpi/tables/tbconvrt.c
--- linux-2.4.2-pre2/drivers/acpi/tables/tbconvrt.c	Mon Jan 29 10:15:59 2001
+++ linux/drivers/acpi/tables/tbconvrt.c	Mon Dec  3 22:28:20 2001
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Module Name: tbconvrt - ACPI Table conversion utilities
- *              $Revision: 18 $
+ *              $Revision: 19 $
  *
  *****************************************************************************/
 
diff -urN linux-2.4.2-pre2/drivers/atm/fore200e.c linux/drivers/atm/fore200e.c
--- linux-2.4.2-pre2/drivers/atm/fore200e.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/atm/fore200e.c	Mon Dec  3 22:28:20 2001
@@ -28,7 +28,7 @@
 #include <linux/version.h>
 #include <linux/config.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/capability.h>
 #include <linux/sched.h>
diff -urN linux-2.4.2-pre2/drivers/block/DAC960.c linux/drivers/block/DAC960.c
--- linux-2.4.2-pre2/drivers/block/DAC960.c	Sat Jan 20 08:51:40 2001
+++ linux/drivers/block/DAC960.c	Mon Dec  3 22:28:20 2001
@@ -34,7 +34,7 @@
 #include <linux/ioport.h>
 #include <linux/locks.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/proc_fs.h>
 #include <linux/reboot.h>
 #include <linux/spinlock.h>
diff -urN linux-2.4.2-pre2/drivers/block/acsi.c linux/drivers/block/acsi.c
--- linux-2.4.2-pre2/drivers/block/acsi.c	Sun Dec 31 10:31:33 2000
+++ linux/drivers/block/acsi.c	Mon Dec  3 22:28:20 2001
@@ -59,7 +59,7 @@
 #include <linux/mm.h>
 #include <linux/major.h>
 #include <linux/blk.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <scsi/scsi.h> /* for SCSI_IOCTL_GET_IDLUN */
 typedef void Scsi_Device; /* hack to avoid including scsi.h */
diff -urN linux-2.4.2-pre2/drivers/block/acsi_slm.c linux/drivers/block/acsi_slm.c
--- linux-2.4.2-pre2/drivers/block/acsi_slm.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/block/acsi_slm.c	Mon Dec  3 22:28:20 2001
@@ -64,7 +64,7 @@
 #include <linux/interrupt.h>
 #include <linux/time.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/devfs_fs_kernel.h>
 #include <linux/smp_lock.h>
 
diff -urN linux-2.4.2-pre2/drivers/block/ataflop.c linux/drivers/block/ataflop.c
--- linux-2.4.2-pre2/drivers/block/ataflop.c	Thu Jan  4 13:00:55 2001
+++ linux/drivers/block/ataflop.c	Mon Dec  3 22:28:20 2001
@@ -74,7 +74,7 @@
 #include <linux/types.h>
 #include <linux/delay.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 
 #include <asm/setup.h>
diff -urN linux-2.4.2-pre2/drivers/block/cciss.c linux/drivers/block/cciss.c
--- linux-2.4.2-pre2/drivers/block/cciss.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/block/cciss.c	Mon Dec  3 22:28:20 2001
@@ -26,7 +26,7 @@
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/major.h>
 #include <linux/fs.h>
diff -urN linux-2.4.2-pre2/drivers/block/cpqarray.c linux/drivers/block/cpqarray.c
--- linux-2.4.2-pre2/drivers/block/cpqarray.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/block/cpqarray.c	Mon Dec  3 22:28:20 2001
@@ -28,7 +28,7 @@
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/major.h>
 #include <linux/fs.h>
diff -urN linux-2.4.2-pre2/drivers/block/cpqarray.h linux/drivers/block/cpqarray.h
--- linux-2.4.2-pre2/drivers/block/cpqarray.h	Mon Dec 11 12:50:39 2000
+++ linux/drivers/block/cpqarray.h	Mon Dec  3 22:28:20 2001
@@ -28,7 +28,7 @@
 #ifdef __KERNEL__
 #include <linux/blkdev.h>
 #include <linux/locks.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/proc_fs.h>
 #include <linux/timer.h>
 #endif
diff -urN linux-2.4.2-pre2/drivers/block/elevator.c linux/drivers/block/elevator.c
--- linux-2.4.2-pre2/drivers/block/elevator.c	Mon Jan 15 13:08:15 2001
+++ linux/drivers/block/elevator.c	Mon Dec  3 22:28:20 2001
@@ -46,6 +46,8 @@
 			break;
 		}
 
+		if (!*req && BHRQ_IN_ORDER(bh, __rq))
+			*req = __rq;
 		if (__rq->sem)
 			continue;
 		if (__rq->cmd != rw)
@@ -65,8 +67,7 @@
 			__rq->elevator_sequence -= count;
 			*req = __rq;
 			break;
-		} else if (!*req && BHRQ_IN_ORDER(bh, __rq))
-			*req = __rq;
+		}
 	}
 
 	return ret;
diff -urN linux-2.4.2-pre2/drivers/block/floppy.c linux/drivers/block/floppy.c
--- linux-2.4.2-pre2/drivers/block/floppy.c	Thu Oct 26 23:35:47 2000
+++ linux/drivers/block/floppy.c	Mon Dec  3 22:28:20 2001
@@ -152,7 +152,7 @@
 #include <linux/hdreg.h>
 
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/string.h>
 #include <linux/fcntl.h>
diff -urN linux-2.4.2-pre2/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
--- linux-2.4.2-pre2/drivers/block/ll_rw_blk.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/block/ll_rw_blk.c	Mon Dec  3 22:28:20 2001
@@ -576,8 +576,6 @@
 static inline void add_request(request_queue_t * q, struct request * req,
 			       struct list_head *insert_here)
 {
-	int major;
-
 	drive_stat_acct(req->rq_dev, req->cmd, req->nr_sectors, 1);
 
 	if (!q->plugged && q->head_active && insert_here == &q->queue_head) {
diff -urN linux-2.4.2-pre2/drivers/block/loop.c linux/drivers/block/loop.c
--- linux-2.4.2-pre2/drivers/block/loop.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/block/loop.c	Mon Dec  3 22:28:20 2001
@@ -75,7 +75,7 @@
 #define TIMEOUT_VALUE (6 * HZ)
 #include <linux/blk.h>
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 static int max_loop = 8;
 static struct loop_device *loop_dev;
 static int *loop_sizes;
diff -urN linux-2.4.2-pre2/drivers/block/paride/pg.c linux/drivers/block/paride/pg.c
--- linux-2.4.2-pre2/drivers/block/paride/pg.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/block/paride/pg.c	Mon Dec  3 22:28:20 2001
@@ -167,7 +167,7 @@
 #include <linux/devfs_fs_kernel.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mtio.h>
 #include <linux/pg.h>
 #include <linux/wait.h>
diff -urN linux-2.4.2-pre2/drivers/block/paride/pt.c linux/drivers/block/paride/pt.c
--- linux-2.4.2-pre2/drivers/block/paride/pt.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/block/paride/pt.c	Mon Dec  3 22:28:20 2001
@@ -146,7 +146,7 @@
 #include <linux/devfs_fs_kernel.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mtio.h>
 #include <linux/wait.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.4.2-pre2/drivers/block/rd.c linux/drivers/block/rd.c
--- linux-2.4.2-pre2/drivers/block/rd.c	Fri Nov 17 16:46:55 2000
+++ linux/drivers/block/rd.c	Mon Dec  3 22:28:20 2001
@@ -53,7 +53,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioctl.h>
 #include <linux/fd.h>
 #include <linux/module.h>
diff -urN linux-2.4.2-pre2/drivers/block/z2ram.c linux/drivers/block/z2ram.c
--- linux-2.4.2-pre2/drivers/block/z2ram.c	Mon Nov 27 17:11:26 2000
+++ linux/drivers/block/z2ram.c	Mon Dec  3 22:28:20 2001
@@ -28,7 +28,7 @@
 #define MAJOR_NR    Z2RAM_MAJOR
 
 #include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/blk.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/cdrom/cdrom.c linux/drivers/cdrom/cdrom.c
--- linux-2.4.2-pre2/drivers/cdrom/cdrom.c	Sun Jan 28 13:37:50 2001
+++ linux/drivers/cdrom/cdrom.c	Mon Dec  3 22:28:20 2001
@@ -259,7 +259,7 @@
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
-#include <linux/malloc.h> 
+#include <linux/slab.h> 
 #include <linux/cdrom.h>
 #include <linux/sysctl.h>
 #include <linux/proc_fs.h>
diff -urN linux-2.4.2-pre2/drivers/cdrom/cdu31a.c linux/drivers/cdrom/cdu31a.c
--- linux-2.4.2-pre2/drivers/cdrom/cdu31a.c	Thu Oct 26 23:35:47 2000
+++ linux/drivers/cdrom/cdu31a.c	Mon Dec  3 22:28:20 2001
@@ -164,7 +164,7 @@
 #include <linux/ioport.h>
 #include <linux/devfs_fs_kernel.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 
diff -urN linux-2.4.2-pre2/drivers/cdrom/cm206.c linux/drivers/cdrom/cm206.c
--- linux-2.4.2-pre2/drivers/cdrom/cm206.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/cdrom/cm206.c	Mon Dec  3 22:28:20 2001
@@ -190,7 +190,7 @@
 #include <linux/devfs_fs_kernel.h>
 #include <linux/ioport.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 
 /* #include <linux/ucdrom.h> */
diff -urN linux-2.4.2-pre2/drivers/cdrom/gscd.c linux/drivers/cdrom/gscd.c
--- linux-2.4.2-pre2/drivers/cdrom/gscd.c	Thu Oct 26 23:35:47 2000
+++ linux/drivers/cdrom/gscd.c	Mon Dec  3 22:28:20 2001
@@ -50,7 +50,7 @@
 
 #include <linux/module.h>
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
diff -urN linux-2.4.2-pre2/drivers/cdrom/mcdx.c linux/drivers/cdrom/mcdx.c
--- linux-2.4.2-pre2/drivers/cdrom/mcdx.c	Thu Oct 26 23:35:47 2000
+++ linux/drivers/cdrom/mcdx.c	Mon Dec  3 22:28:20 2001
@@ -66,7 +66,7 @@
 #include <linux/cdrom.h>
 #include <linux/ioport.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/drivers/cdrom/sonycd535.c linux/drivers/cdrom/sonycd535.c
--- linux-2.4.2-pre2/drivers/cdrom/sonycd535.c	Thu Oct 26 23:35:48 2000
+++ linux/drivers/cdrom/sonycd535.c	Mon Dec  3 22:28:20 2001
@@ -122,7 +122,7 @@
 #include <linux/hdreg.h>
 #include <linux/genhd.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/devfs_fs_kernel.h>
 
diff -urN linux-2.4.2-pre2/drivers/char/acquirewdt.c linux/drivers/char/acquirewdt.c
--- linux-2.4.2-pre2/drivers/char/acquirewdt.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/acquirewdt.c	Mon Dec  3 22:28:20 2001
@@ -28,7 +28,7 @@
 #include <linux/sched.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/fcntl.h>
 #include <asm/io.h>
diff -urN linux-2.4.2-pre2/drivers/char/agp/agpgart_be.c linux/drivers/char/agp/agpgart_be.c
--- linux-2.4.2-pre2/drivers/char/agp/agpgart_be.c	Sun Jan 28 13:28:09 2001
+++ linux/drivers/char/agp/agpgart_be.c	Mon Dec  3 22:28:20 2001
@@ -32,7 +32,7 @@
 #include <linux/mm.h>
 #include <linux/string.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/pci.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/char/agp/agpgart_fe.c linux/drivers/char/agp/agpgart_fe.c
--- linux-2.4.2-pre2/drivers/char/agp/agpgart_fe.c	Wed Jul 12 21:58:42 2000
+++ linux/drivers/char/agp/agpgart_fe.c	Mon Dec  3 22:28:20 2001
@@ -33,7 +33,7 @@
 #include <linux/mm.h>
 #include <linux/string.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/pci.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/char/amiserial.c linux/drivers/char/amiserial.c
--- linux-2.4.2-pre2/drivers/char/amiserial.c	Thu Jan  4 13:00:55 2001
+++ linux/drivers/char/amiserial.c	Mon Dec  3 22:28:20 2001
@@ -85,7 +85,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 
diff -urN linux-2.4.2-pre2/drivers/char/applicom.c linux/drivers/char/applicom.c
--- linux-2.4.2-pre2/drivers/char/applicom.c	Sun Dec  3 17:45:20 2000
+++ linux/drivers/char/applicom.c	Mon Dec  3 22:28:20 2001
@@ -22,7 +22,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <asm/errno.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/drivers/char/busmouse.c linux/drivers/char/busmouse.c
--- linux-2.4.2-pre2/drivers/char/busmouse.c	Wed Aug  9 14:11:11 2000
+++ linux/drivers/char/busmouse.c	Mon Dec  3 22:28:20 2001
@@ -12,7 +12,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
 #include <linux/poll.h>
diff -urN linux-2.4.2-pre2/drivers/char/console.c linux/drivers/char/console.c
--- linux-2.4.2-pre2/drivers/char/console.c	Fri Nov 10 10:56:47 2000
+++ linux/drivers/char/console.c	Mon Dec  3 22:28:20 2001
@@ -79,7 +79,7 @@
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/kd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/major.h>
 #include <linux/mm.h>
 #include <linux/console.h>
diff -urN linux-2.4.2-pre2/drivers/char/consolemap.c linux/drivers/char/consolemap.c
--- linux-2.4.2-pre2/drivers/char/consolemap.c	Tue Jul  6 19:16:55 1999
+++ linux/drivers/char/consolemap.c	Mon Dec  3 22:28:20 2001
@@ -14,8 +14,9 @@
 #include <linux/kd.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
+#include <linux/tty.h>
 #include <asm/uaccess.h>
 #include <linux/consolemap.h>
 #include <linux/console_struct.h>
diff -urN linux-2.4.2-pre2/drivers/char/dsp56k.c linux/drivers/char/dsp56k.c
--- linux-2.4.2-pre2/drivers/char/dsp56k.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/dsp56k.c	Mon Dec  3 22:28:20 2001
@@ -25,7 +25,7 @@
 
 #include <linux/module.h>
 #include <linux/version.h>
-#include <linux/malloc.h>	/* for kmalloc() and kfree() */
+#include <linux/slab.h>	/* for kmalloc() and kfree() */
 #include <linux/sched.h>	/* for struct wait_queue etc */
 #include <linux/major.h>
 #include <linux/types.h>
diff -urN linux-2.4.2-pre2/drivers/char/dz.c linux/drivers/char/dz.c
--- linux-2.4.2-pre2/drivers/char/dz.c	Thu Oct 12 14:20:47 2000
+++ linux/drivers/char/dz.c	Mon Dec  3 22:28:20 2001
@@ -33,7 +33,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/init.h> 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/major.h>
 #include <linux/param.h>
diff -urN linux-2.4.2-pre2/drivers/char/esp.c linux/drivers/char/esp.c
--- linux-2.4.2-pre2/drivers/char/esp.c	Wed Dec  6 12:06:18 2000
+++ linux/drivers/char/esp.c	Mon Dec  3 22:28:20 2001
@@ -61,7 +61,7 @@
 #include <asm/bitops.h>
 
 #include <asm/dma.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <asm/uaccess.h>
 
 #include <linux/hayesesp.h>
diff -urN linux-2.4.2-pre2/drivers/char/ftape/lowlevel/ftape-buffer.c linux/drivers/char/ftape/lowlevel/ftape-buffer.c
--- linux-2.4.2-pre2/drivers/char/ftape/lowlevel/ftape-buffer.c	Tue Aug  8 09:11:04 2000
+++ linux/drivers/char/ftape/lowlevel/ftape-buffer.c	Mon Dec  3 22:28:20 2001
@@ -25,7 +25,7 @@
  */
 
 #include <asm/segment.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
 #include <linux/wrapper.h>
diff -urN linux-2.4.2-pre2/drivers/char/ftape/zftape/zftape-buffers.c linux/drivers/char/ftape/zftape/zftape-buffers.c
--- linux-2.4.2-pre2/drivers/char/ftape/zftape/zftape-buffers.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/ftape/zftape/zftape-buffers.c	Mon Dec  3 22:28:20 2001
@@ -26,7 +26,7 @@
 
 #include <linux/errno.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <asm/segment.h>
 
 #include <linux/zftape.h>
diff -urN linux-2.4.2-pre2/drivers/char/ftape/zftape/zftape-init.c linux/drivers/char/ftape/zftape/zftape-init.c
--- linux-2.4.2-pre2/drivers/char/ftape/zftape/zftape-init.c	Wed Jul 12 21:58:42 2000
+++ linux/drivers/char/ftape/zftape/zftape-init.c	Mon Dec  3 22:28:20 2001
@@ -29,7 +29,7 @@
 #include <linux/kernel.h>
 #include <linux/signal.h>
 #include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #ifdef CONFIG_KMOD
 #include <linux/kmod.h>
 #endif
diff -urN linux-2.4.2-pre2/drivers/char/ftape/zftape/zftape-vtbl.c linux/drivers/char/ftape/zftape/zftape-vtbl.c
--- linux-2.4.2-pre2/drivers/char/ftape/zftape/zftape-vtbl.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/ftape/zftape/zftape-vtbl.c	Mon Dec  3 22:28:20 2001
@@ -30,7 +30,7 @@
 
 #include <linux/errno.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <asm/segment.h>
 
 #include <linux/zftape.h>
diff -urN linux-2.4.2-pre2/drivers/char/ip2main.c linux/drivers/char/ip2main.c
--- linux-2.4.2-pre2/drivers/char/ip2main.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/ip2main.c	Mon Dec  3 22:28:20 2001
@@ -75,7 +75,7 @@
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/major.h>
 #include <linux/wait.h>
 
diff -urN linux-2.4.2-pre2/drivers/char/istallion.c linux/drivers/char/istallion.c
--- linux-2.4.2-pre2/drivers/char/istallion.c	Wed Dec  6 12:06:18 2000
+++ linux/drivers/char/istallion.c	Mon Dec  3 22:28:20 2001
@@ -28,8 +28,9 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
+#include <linux/tty.h>
 #include <linux/tty_flip.h>
 #include <linux/serial.h>
 #include <linux/cdk.h>
diff -urN linux-2.4.2-pre2/drivers/char/joystick/a3d.c linux/drivers/char/joystick/a3d.c
--- linux-2.4.2-pre2/drivers/char/joystick/a3d.c	Thu Jun 22 06:59:58 2000
+++ linux/drivers/char/joystick/a3d.c	Mon Dec  3 22:28:20 2001
@@ -32,7 +32,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/gameport.h>
 #include <linux/input.h>
diff -urN linux-2.4.2-pre2/drivers/char/joystick/adi.c linux/drivers/char/joystick/adi.c
--- linux-2.4.2-pre2/drivers/char/joystick/adi.c	Fri Nov 17 16:52:23 2000
+++ linux/drivers/char/joystick/adi.c	Mon Dec  3 22:28:20 2001
@@ -34,7 +34,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/input.h>
 #include <linux/gameport.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/char/joystick/analog.c linux/drivers/char/joystick/analog.c
--- linux-2.4.2-pre2/drivers/char/joystick/analog.c	Tue Nov 14 13:16:33 2000
+++ linux/drivers/char/joystick/analog.c	Mon Dec  3 22:28:20 2001
@@ -34,7 +34,7 @@
 #include <linux/delay.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/bitops.h>
 #include <linux/init.h>
 #include <linux/input.h>
diff -urN linux-2.4.2-pre2/drivers/char/joystick/cobra.c linux/drivers/char/joystick/cobra.c
--- linux-2.4.2-pre2/drivers/char/joystick/cobra.c	Wed Jun 21 08:22:21 2000
+++ linux/drivers/char/joystick/cobra.c	Mon Dec  3 22:28:20 2001
@@ -32,7 +32,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/gameport.h>
 #include <linux/input.h>
diff -urN linux-2.4.2-pre2/drivers/char/joystick/gameport.c linux/drivers/char/joystick/gameport.c
--- linux-2.4.2-pre2/drivers/char/joystick/gameport.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/joystick/gameport.c	Mon Dec  3 22:28:20 2001
@@ -35,7 +35,7 @@
 #include <linux/ioport.h>
 #include <linux/init.h>
 #include <linux/gameport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/isapnp.h>
 #include <linux/stddef.h>
 #include <linux/delay.h>
diff -urN linux-2.4.2-pre2/drivers/char/joystick/gf2k.c linux/drivers/char/joystick/gf2k.c
--- linux-2.4.2-pre2/drivers/char/joystick/gf2k.c	Wed Jun 21 08:22:21 2000
+++ linux/drivers/char/joystick/gf2k.c	Mon Dec  3 22:28:20 2001
@@ -32,7 +32,7 @@
 
 #include <linux/delay.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/input.h>
diff -urN linux-2.4.2-pre2/drivers/char/joystick/grip.c linux/drivers/char/joystick/grip.c
--- linux-2.4.2-pre2/drivers/char/joystick/grip.c	Wed Jun 21 08:22:21 2000
+++ linux/drivers/char/joystick/grip.c	Mon Dec  3 22:28:20 2001
@@ -33,7 +33,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/gameport.h>
 #include <linux/input.h>
 
diff -urN linux-2.4.2-pre2/drivers/char/joystick/iforce.c linux/drivers/char/joystick/iforce.c
--- linux-2.4.2-pre2/drivers/char/joystick/iforce.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/char/joystick/iforce.c	Mon Dec  3 22:28:20 2001
@@ -29,7 +29,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/input.h>
 #include <linux/module.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/char/joystick/interact.c linux/drivers/char/joystick/interact.c
--- linux-2.4.2-pre2/drivers/char/joystick/interact.c	Wed Jun 21 08:22:21 2000
+++ linux/drivers/char/joystick/interact.c	Mon Dec  3 22:28:20 2001
@@ -34,7 +34,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/char/joystick/lightning.c linux/drivers/char/joystick/lightning.c
--- linux-2.4.2-pre2/drivers/char/joystick/lightning.c	Wed Jun 21 08:22:21 2000
+++ linux/drivers/char/joystick/lightning.c	Mon Dec  3 22:28:20 2001
@@ -38,7 +38,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/gameport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #define L4_PORT			0x201
 #define L4_SELECT_ANALOG	0xa4
diff -urN linux-2.4.2-pre2/drivers/char/joystick/magellan.c linux/drivers/char/joystick/magellan.c
--- linux-2.4.2-pre2/drivers/char/joystick/magellan.c	Wed Jun 21 08:22:21 2000
+++ linux/drivers/char/joystick/magellan.c	Mon Dec  3 22:28:20 2001
@@ -32,7 +32,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/input.h>
 #include <linux/serio.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/char/joystick/ns558.c linux/drivers/char/joystick/ns558.c
--- linux-2.4.2-pre2/drivers/char/joystick/ns558.c	Fri Nov 17 16:52:23 2000
+++ linux/drivers/char/joystick/ns558.c	Mon Dec  3 22:28:20 2001
@@ -38,7 +38,7 @@
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/gameport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/isapnp.h>
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
diff -urN linux-2.4.2-pre2/drivers/char/joystick/serport.c linux/drivers/char/joystick/serport.c
--- linux-2.4.2-pre2/drivers/char/joystick/serport.c	Wed Jun 21 08:22:21 2000
+++ linux/drivers/char/joystick/serport.c	Mon Dec  3 22:28:20 2001
@@ -33,7 +33,7 @@
 
 #include <asm/uaccess.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/serio.h>
diff -urN linux-2.4.2-pre2/drivers/char/joystick/sidewinder.c linux/drivers/char/joystick/sidewinder.c
--- linux-2.4.2-pre2/drivers/char/joystick/sidewinder.c	Fri Nov 17 16:52:23 2000
+++ linux/drivers/char/joystick/sidewinder.c	Mon Dec  3 22:28:20 2001
@@ -33,7 +33,7 @@
 #include <linux/delay.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/input.h>
 #include <linux/gameport.h>
diff -urN linux-2.4.2-pre2/drivers/char/joystick/spaceball.c linux/drivers/char/joystick/spaceball.c
--- linux-2.4.2-pre2/drivers/char/joystick/spaceball.c	Mon Aug 14 13:55:01 2000
+++ linux/drivers/char/joystick/spaceball.c	Mon Dec  3 22:28:20 2001
@@ -35,7 +35,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/input.h>
diff -urN linux-2.4.2-pre2/drivers/char/joystick/spaceorb.c linux/drivers/char/joystick/spaceorb.c
--- linux-2.4.2-pre2/drivers/char/joystick/spaceorb.c	Wed Jun 21 08:22:21 2000
+++ linux/drivers/char/joystick/spaceorb.c	Mon Dec  3 22:28:20 2001
@@ -34,7 +34,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/input.h>
diff -urN linux-2.4.2-pre2/drivers/char/joystick/tmdc.c linux/drivers/char/joystick/tmdc.c
--- linux-2.4.2-pre2/drivers/char/joystick/tmdc.c	Wed Jun 21 08:22:21 2000
+++ linux/drivers/char/joystick/tmdc.c	Mon Dec  3 22:28:20 2001
@@ -36,7 +36,7 @@
 
 #include <linux/delay.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/gameport.h>
diff -urN linux-2.4.2-pre2/drivers/char/joystick/warrior.c linux/drivers/char/joystick/warrior.c
--- linux-2.4.2-pre2/drivers/char/joystick/warrior.c	Wed Jun 21 08:22:21 2000
+++ linux/drivers/char/joystick/warrior.c	Mon Dec  3 22:28:20 2001
@@ -32,7 +32,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/input.h>
 #include <linux/serio.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/char/lp.c linux/drivers/char/lp.c
--- linux-2.4.2-pre2/drivers/char/lp.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/char/lp.c	Mon Dec  3 22:28:20 2001
@@ -121,7 +121,7 @@
 #include <linux/sched.h>
 #include <linux/smp_lock.h>
 #include <linux/devfs_fs_kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
 #include <linux/delay.h>
 #include <linux/poll.h>
diff -urN linux-2.4.2-pre2/drivers/char/mem.c linux/drivers/char/mem.c
--- linux-2.4.2-pre2/drivers/char/mem.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/char/mem.c	Mon Dec  3 22:28:20 2001
@@ -13,12 +13,13 @@
 #include <linux/miscdevice.h>
 #include <linux/tpqic02.h>
 #include <linux/ftape.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/mman.h>
 #include <linux/random.h>
 #include <linux/init.h>
 #include <linux/raw.h>
+#include <linux/tty.h>
 #include <linux/capability.h>
 
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/drivers/char/misc.c linux/drivers/char/misc.c
--- linux-2.4.2-pre2/drivers/char/misc.c	Mon Jan 22 13:30:20 2001
+++ linux/drivers/char/misc.c	Mon Dec  3 22:28:20 2001
@@ -41,7 +41,7 @@
 #include <linux/miscdevice.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/proc_fs.h>
 #include <linux/devfs_fs_kernel.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/char/n_hdlc.c linux/drivers/char/n_hdlc.c
--- linux-2.4.2-pre2/drivers/char/n_hdlc.c	Tue Nov  7 10:36:57 2000
+++ linux/drivers/char/n_hdlc.c	Mon Dec  3 22:28:20 2001
@@ -96,7 +96,7 @@
 
 #include <linux/poll.h>
 #include <linux/in.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/tty.h>
 #include <linux/errno.h>
 #include <linux/string.h>	/* used in new tty drivers */
diff -urN linux-2.4.2-pre2/drivers/char/n_r3964.c linux/drivers/char/n_r3964.c
--- linux-2.4.2-pre2/drivers/char/n_r3964.c	Mon Dec 11 12:57:28 2000
+++ linux/drivers/char/n_r3964.c	Mon Dec  3 22:28:20 2001
@@ -51,7 +51,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/tty.h>
 #include <linux/errno.h>
 #include <linux/string.h>   /* used in new tty drivers */
diff -urN linux-2.4.2-pre2/drivers/char/n_tty.c linux/drivers/char/n_tty.c
--- linux-2.4.2-pre2/drivers/char/n_tty.c	Mon Jan 15 18:58:04 2001
+++ linux/drivers/char/n_tty.c	Mon Dec  3 22:28:20 2001
@@ -38,7 +38,7 @@
 #include <linux/kd.h>
 #include <linux/mm.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/poll.h>
 
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/drivers/char/nvram.c linux/drivers/char/nvram.c
--- linux-2.4.2-pre2/drivers/char/nvram.c	Thu Jan  4 12:50:17 2001
+++ linux/drivers/char/nvram.c	Mon Dec  3 22:28:20 2001
@@ -94,7 +94,7 @@
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/fcntl.h>
 #include <linux/mc146818rtc.h>
@@ -481,7 +481,8 @@
 #ifdef CONFIG_PROC_FS
 
 static char *floppy_types[] = {
-	"none", "5.25'' 360k", "5.25'' 1.2M", "3.5'' 720k", "3.5'' 1.44M", "3.5'' 2.88M"
+	"none", "5.25'' 360k", "5.25'' 1.2M", "3.5'' 720k", "3.5'' 1.44M",
+	"3.5'' 2.88M", "3.5'' 2.88M"
 };
 
 static char *gfx_types[] = {
diff -urN linux-2.4.2-pre2/drivers/char/pc_keyb.c linux/drivers/char/pc_keyb.c
--- linux-2.4.2-pre2/drivers/char/pc_keyb.c	Mon Oct 23 15:51:36 2000
+++ linux/drivers/char/pc_keyb.c	Mon Dec  3 22:28:20 2001
@@ -29,7 +29,7 @@
 #include <linux/random.h>
 #include <linux/poll.h>
 #include <linux/miscdevice.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/kbd_kern.h>
 #include <linux/smp_lock.h>
 
diff -urN linux-2.4.2-pre2/drivers/char/pcmcia/serial_cb.c linux/drivers/char/pcmcia/serial_cb.c
--- linux-2.4.2-pre2/drivers/char/pcmcia/serial_cb.c	Sat Sep  2 00:15:37 2000
+++ linux/drivers/char/pcmcia/serial_cb.c	Mon Dec  3 22:28:20 2001
@@ -24,7 +24,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/tty.h>
 #include <linux/serial.h>
diff -urN linux-2.4.2-pre2/drivers/char/pcmcia/serial_cs.c linux/drivers/char/pcmcia/serial_cs.c
--- linux-2.4.2-pre2/drivers/char/pcmcia/serial_cs.c	Sat Sep  2 00:15:37 2000
+++ linux/drivers/char/pcmcia/serial_cs.c	Mon Dec  3 22:28:20 2001
@@ -36,7 +36,7 @@
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/tty.h>
diff -urN linux-2.4.2-pre2/drivers/char/pcwd.c linux/drivers/char/pcwd.c
--- linux-2.4.2-pre2/drivers/char/pcwd.c	Sun Oct  1 19:45:29 2000
+++ linux/drivers/char/pcwd.c	Mon Dec  3 22:28:20 2001
@@ -53,7 +53,7 @@
 #include <linux/kernel.h>
 #include <linux/wait.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
 #include <linux/miscdevice.h>
diff -urN linux-2.4.2-pre2/drivers/char/pcxx.c linux/drivers/char/pcxx.c
--- linux-2.4.2-pre2/drivers/char/pcxx.c	Mon Jan  1 10:34:54 2001
+++ linux/drivers/char/pcxx.c	Mon Dec  3 22:28:20 2001
@@ -63,7 +63,7 @@
 #include <linux/delay.h>
 #include <linux/serial.h>
 #include <linux/tty_driver.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/version.h>
 
diff -urN linux-2.4.2-pre2/drivers/char/q40_keyb.c linux/drivers/char/q40_keyb.c
--- linux-2.4.2-pre2/drivers/char/q40_keyb.c	Mon Nov 27 17:57:34 2000
+++ linux/drivers/char/q40_keyb.c	Mon Dec  3 22:28:20 2001
@@ -21,7 +21,7 @@
 #include <linux/random.h>
 #include <linux/poll.h>
 #include <linux/miscdevice.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <asm/keyboard.h>
 #include <asm/bitops.h>
diff -urN linux-2.4.2-pre2/drivers/char/qpmouse.c linux/drivers/char/qpmouse.c
--- linux-2.4.2-pre2/drivers/char/qpmouse.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/qpmouse.c	Mon Dec  3 22:28:20 2001
@@ -31,7 +31,7 @@
 #include <linux/fcntl.h>
 #include <linux/errno.h>
 #include <linux/timer.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/miscdevice.h>
 #include <linux/random.h>
 #include <linux/poll.h>
diff -urN linux-2.4.2-pre2/drivers/char/random.c linux/drivers/char/random.c
--- linux-2.4.2-pre2/drivers/char/random.c	Sun Nov 12 21:55:50 2000
+++ linux/drivers/char/random.c	Mon Dec  3 22:28:20 2001
@@ -240,7 +240,7 @@
 #include <linux/major.h>
 #include <linux/string.h>
 #include <linux/fcntl.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/poll.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/char/rio/rio_linux.c linux/drivers/char/rio/rio_linux.c
--- linux-2.4.2-pre2/drivers/char/rio/rio_linux.c	Thu Nov 16 12:51:27 2000
+++ linux/drivers/char/rio/rio_linux.c	Mon Dec  3 22:28:20 2001
@@ -56,7 +56,7 @@
 #include <linux/tqueue.h>
 #include <linux/version.h>
 #include <linux/pci.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/miscdevice.h>
 
 #include <linux/compatmac.h>
diff -urN linux-2.4.2-pre2/drivers/char/rio/rioboot.c linux/drivers/char/rio/rioboot.c
--- linux-2.4.2-pre2/drivers/char/rio/rioboot.c	Fri Aug 11 14:51:33 2000
+++ linux/drivers/char/rio/rioboot.c	Mon Dec  3 22:28:20 2001
@@ -36,7 +36,7 @@
 
 #define __NO_VERSION__
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/system.h>
diff -urN linux-2.4.2-pre2/drivers/char/rio/riocmd.c linux/drivers/char/rio/riocmd.c
--- linux-2.4.2-pre2/drivers/char/rio/riocmd.c	Fri Aug 11 14:51:33 2000
+++ linux/drivers/char/rio/riocmd.c	Mon Dec  3 22:28:20 2001
@@ -36,8 +36,9 @@
 
 #define __NO_VERSION__
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
+#include <linux/tty.h>
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/string.h>
diff -urN linux-2.4.2-pre2/drivers/char/rio/rioctrl.c linux/drivers/char/rio/rioctrl.c
--- linux-2.4.2-pre2/drivers/char/rio/rioctrl.c	Fri Aug 11 14:51:33 2000
+++ linux/drivers/char/rio/rioctrl.c	Mon Dec  3 22:28:20 2001
@@ -36,7 +36,7 @@
 
 #define __NO_VERSION__
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/system.h>
diff -urN linux-2.4.2-pre2/drivers/char/rio/rioinit.c linux/drivers/char/rio/rioinit.c
--- linux-2.4.2-pre2/drivers/char/rio/rioinit.c	Fri Aug 11 14:51:33 2000
+++ linux/drivers/char/rio/rioinit.c	Mon Dec  3 22:28:20 2001
@@ -36,7 +36,7 @@
 #define __NO_VERSION__
 #include <linux/config.h>
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/system.h>
diff -urN linux-2.4.2-pre2/drivers/char/rio/riointr.c linux/drivers/char/rio/riointr.c
--- linux-2.4.2-pre2/drivers/char/rio/riointr.c	Fri Aug 11 14:51:33 2000
+++ linux/drivers/char/rio/riointr.c	Mon Dec  3 22:28:20 2001
@@ -36,8 +36,9 @@
 
 #define __NO_VERSION__
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
+#include <linux/tty.h>
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/string.h>
diff -urN linux-2.4.2-pre2/drivers/char/rio/rioparam.c linux/drivers/char/rio/rioparam.c
--- linux-2.4.2-pre2/drivers/char/rio/rioparam.c	Fri Aug 11 14:51:33 2000
+++ linux/drivers/char/rio/rioparam.c	Mon Dec  3 22:28:20 2001
@@ -36,8 +36,9 @@
 
 #define __NO_VERSION__
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
+#include <linux/tty.h>
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/string.h>
diff -urN linux-2.4.2-pre2/drivers/char/rio/rioroute.c linux/drivers/char/rio/rioroute.c
--- linux-2.4.2-pre2/drivers/char/rio/rioroute.c	Fri Aug 11 14:51:33 2000
+++ linux/drivers/char/rio/rioroute.c	Mon Dec  3 22:28:20 2001
@@ -35,7 +35,7 @@
 
 #define __NO_VERSION__
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/system.h>
diff -urN linux-2.4.2-pre2/drivers/char/rio/riotable.c linux/drivers/char/rio/riotable.c
--- linux-2.4.2-pre2/drivers/char/rio/riotable.c	Fri Aug 11 14:51:33 2000
+++ linux/drivers/char/rio/riotable.c	Mon Dec  3 22:28:20 2001
@@ -35,7 +35,7 @@
 
 #define __NO_VERSION__
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/system.h>
diff -urN linux-2.4.2-pre2/drivers/char/rio/riotty.c linux/drivers/char/rio/riotty.c
--- linux-2.4.2-pre2/drivers/char/rio/riotty.c	Fri Aug 11 14:51:33 2000
+++ linux/drivers/char/rio/riotty.c	Mon Dec  3 22:28:20 2001
@@ -38,8 +38,9 @@
 
 #define __NO_VERSION__
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
+#include <linux/tty.h>
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/string.h>
diff -urN linux-2.4.2-pre2/drivers/char/rocket.c linux/drivers/char/rocket.c
--- linux-2.4.2-pre2/drivers/char/rocket.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/rocket.c	Mon Dec  3 22:28:20 2001
@@ -66,7 +66,7 @@
 #include <linux/major.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 
 #include <linux/sched.h>
diff -urN linux-2.4.2-pre2/drivers/char/sbc60xxwdt.c linux/drivers/char/sbc60xxwdt.c
--- linux-2.4.2-pre2/drivers/char/sbc60xxwdt.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/sbc60xxwdt.c	Mon Dec  3 22:28:20 2001
@@ -63,7 +63,7 @@
 #include <linux/sched.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/fcntl.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.4.2-pre2/drivers/char/scan_keyb.c linux/drivers/char/scan_keyb.c
--- linux-2.4.2-pre2/drivers/char/scan_keyb.c	Mon Dec 11 12:39:44 2000
+++ linux/drivers/char/scan_keyb.c	Mon Dec  3 22:28:20 2001
@@ -16,7 +16,7 @@
 #include <linux/random.h>
 #include <linux/poll.h>
 #include <linux/miscdevice.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/kbd_kern.h>
 
 struct scan_keyboard {
diff -urN linux-2.4.2-pre2/drivers/char/selection.c linux/drivers/char/selection.c
--- linux-2.4.2-pre2/drivers/char/selection.c	Mon Oct 16 12:58:51 2000
+++ linux/drivers/char/selection.c	Mon Dec  3 22:28:20 2001
@@ -15,7 +15,7 @@
 #include <linux/tty.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/types.h>
 
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/drivers/char/serial_21285.c linux/drivers/char/serial_21285.c
--- linux-2.4.2-pre2/drivers/char/serial_21285.c	Thu Oct 12 14:20:47 2000
+++ linux/drivers/char/serial_21285.c	Mon Dec  3 22:28:20 2001
@@ -19,7 +19,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/console.h>
 
diff -urN linux-2.4.2-pre2/drivers/char/serial_amba.c linux/drivers/char/serial_amba.c
--- linux-2.4.2-pre2/drivers/char/serial_amba.c	Thu Oct 12 14:20:47 2000
+++ linux/drivers/char/serial_amba.c	Mon Dec  3 22:28:20 2001
@@ -48,7 +48,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/circ_buf.h>
 #include <linux/serial.h>
diff -urN linux-2.4.2-pre2/drivers/char/sh-sci.c linux/drivers/char/sh-sci.c
--- linux-2.4.2-pre2/drivers/char/sh-sci.c	Fri Dec 29 14:35:47 2000
+++ linux/drivers/char/sh-sci.c	Mon Dec  3 22:28:20 2001
@@ -29,7 +29,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 #ifdef CONFIG_SERIAL_CONSOLE
diff -urN linux-2.4.2-pre2/drivers/char/stallion.c linux/drivers/char/stallion.c
--- linux-2.4.2-pre2/drivers/char/stallion.c	Wed Dec  6 12:06:18 2000
+++ linux/drivers/char/stallion.c	Mon Dec  3 22:28:20 2001
@@ -29,8 +29,9 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/version.h> /* for linux/stallion.h */
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
+#include <linux/tty.h>
 #include <linux/tty_flip.h>
 #include <linux/serial.h>
 #include <linux/cd1400.h>
diff -urN linux-2.4.2-pre2/drivers/char/synclink.c linux/drivers/char/synclink.c
--- linux-2.4.2-pre2/drivers/char/synclink.c	Tue Nov  7 10:36:42 2000
+++ linux/drivers/char/synclink.c	Mon Dec  3 22:28:20 2001
@@ -78,7 +78,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <linux/netdevice.h>
 
diff -urN linux-2.4.2-pre2/drivers/char/sysrq.c linux/drivers/char/sysrq.c
--- linux-2.4.2-pre2/drivers/char/sysrq.c	Sun Dec  3 17:48:19 2000
+++ linux/drivers/char/sysrq.c	Mon Dec  3 22:28:20 2001
@@ -13,6 +13,7 @@
 #include <linux/interrupt.h>
 #include <linux/mm.h>
 #include <linux/fs.h>
+#include <linux/tty.h>
 #include <linux/mount.h>
 #include <linux/kdev_t.h>
 #include <linux/major.h>
diff -urN linux-2.4.2-pre2/drivers/char/tpqic02.c linux/drivers/char/tpqic02.c
--- linux-2.4.2-pre2/drivers/char/tpqic02.c	Wed Dec  6 11:46:39 2000
+++ linux/drivers/char/tpqic02.c	Mon Dec  3 22:28:20 2001
@@ -87,7 +87,7 @@
 #include <linux/ioport.h>
 #include <linux/tpqic02.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/smp_lock.h>
 #include <linux/devfs_fs_kernel.h> 
diff -urN linux-2.4.2-pre2/drivers/char/tty_io.c linux/drivers/char/tty_io.c
--- linux-2.4.2-pre2/drivers/char/tty_io.c	Sat Dec 30 18:16:13 2000
+++ linux/drivers/char/tty_io.c	Mon Dec  3 22:28:20 2001
@@ -81,7 +81,7 @@
 #include <linux/kd.h>
 #include <linux/mm.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/poll.h>
 #include <linux/proc_fs.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/char/vme_scc.c linux/drivers/char/vme_scc.c
--- linux-2.4.2-pre2/drivers/char/vme_scc.c	Mon Nov 27 17:11:26 2000
+++ linux/drivers/char/vme_scc.c	Mon Dec  3 22:28:20 2001
@@ -31,7 +31,7 @@
 #include <linux/delay.h>
 #include <linux/tqueue.h>
 #include <linux/version.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/miscdevice.h>
 #include <linux/console.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/char/vt.c linux/drivers/char/vt.c
--- linux-2.4.2-pre2/drivers/char/vt.c	Thu Jan  4 13:00:55 2001
+++ linux/drivers/char/vt.c	Mon Dec  3 22:28:20 2001
@@ -19,7 +19,7 @@
 #include <linux/kd.h>
 #include <linux/vt.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/major.h>
 #include <linux/fs.h>
 #include <linux/console.h>
diff -urN linux-2.4.2-pre2/drivers/char/wdt.c linux/drivers/char/wdt.c
--- linux-2.4.2-pre2/drivers/char/wdt.c	Sun Oct  1 19:45:29 2000
+++ linux/drivers/char/wdt.c	Mon Dec  3 22:28:20 2001
@@ -40,7 +40,7 @@
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
 #include "wd501p.h"
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/fcntl.h>
 #include <asm/io.h>
diff -urN linux-2.4.2-pre2/drivers/char/wdt_pci.c linux/drivers/char/wdt_pci.c
--- linux-2.4.2-pre2/drivers/char/wdt_pci.c	Sun Oct  1 19:45:29 2000
+++ linux/drivers/char/wdt_pci.c	Mon Dec  3 22:28:20 2001
@@ -43,7 +43,7 @@
 #include <linux/watchdog.h>
 #define WDT_IS_PCI
 #include "wd501p.h"
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/fcntl.h>
 #include <asm/io.h>
diff -urN linux-2.4.2-pre2/drivers/dio/dio.c linux/drivers/dio/dio.c
--- linux-2.4.2-pre2/drivers/dio/dio.c	Thu Aug  5 14:34:02 1999
+++ linux/drivers/dio/dio.c	Mon Dec  3 22:28:20 2001
@@ -28,7 +28,7 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/dio.h>
-#include <linux/malloc.h>                         /* kmalloc() */
+#include <linux/slab.h>                         /* kmalloc() */
 #include <linux/init.h>
 #include <asm/hwtest.h>                           /* hwreg_present() */
 #include <asm/io.h>                               /* readb() */
diff -urN linux-2.4.2-pre2/drivers/fc4/fc.c linux/drivers/fc4/fc.c
--- linux-2.4.2-pre2/drivers/fc4/fc.c	Fri Feb 18 15:07:20 2000
+++ linux/drivers/fc4/fc.c	Mon Dec  3 22:28:20 2001
@@ -30,7 +30,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/init.h>
 #include <linux/blk.h>
diff -urN linux-2.4.2-pre2/drivers/fc4/soc.c linux/drivers/fc4/soc.c
--- linux-2.4.2-pre2/drivers/fc4/soc.c	Thu Jan 27 08:58:15 2000
+++ linux/drivers/fc4/soc.c	Mon Dec  3 22:28:20 2001
@@ -29,7 +29,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/init.h>
 #include <asm/bitops.h>
diff -urN linux-2.4.2-pre2/drivers/fc4/socal.c linux/drivers/fc4/socal.c
--- linux-2.4.2-pre2/drivers/fc4/socal.c	Thu Jan 27 08:58:15 2000
+++ linux/drivers/fc4/socal.c	Mon Dec  3 22:28:20 2001
@@ -24,7 +24,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/init.h>
 #include <asm/system.h>
diff -urN linux-2.4.2-pre2/drivers/i2c/i2c-algo-bit.c linux/drivers/i2c/i2c-algo-bit.c
--- linux-2.4.2-pre2/drivers/i2c/i2c-algo-bit.c	Sun Oct  1 20:35:16 2000
+++ linux/drivers/i2c/i2c-algo-bit.c	Mon Dec  3 22:28:20 2001
@@ -26,7 +26,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/delay.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/version.h>
 #include <linux/init.h>
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/drivers/i2c/i2c-algo-pcf.c linux/drivers/i2c/i2c-algo-pcf.c
--- linux-2.4.2-pre2/drivers/i2c/i2c-algo-pcf.c	Fri Dec 29 14:35:47 2000
+++ linux/drivers/i2c/i2c-algo-pcf.c	Mon Dec  3 22:28:20 2001
@@ -29,7 +29,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/delay.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/version.h>
 #include <linux/init.h>
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/drivers/i2c/i2c-core.c linux/drivers/i2c/i2c-core.c
--- linux-2.4.2-pre2/drivers/i2c/i2c-core.c	Fri Dec 29 14:35:47 2000
+++ linux/drivers/i2c/i2c-core.c	Mon Dec  3 22:28:20 2001
@@ -25,7 +25,7 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/proc_fs.h>
 #include <linux/config.h>
 
@@ -1277,31 +1277,14 @@
 }
 
 #ifndef MODULE
-#ifdef CONFIG_I2C_CHARDEV
 	extern int i2c_dev_init(void);
-#endif
-#ifdef CONFIG_I2C_ALGOBIT
 	extern int i2c_algo_bit_init(void);
-#endif
-#ifdef CONFIG_I2C_BITLP
 	extern int i2c_bitlp_init(void);
-#endif
-#ifdef CONFIG_I2C_BITELV
 	extern int i2c_bitelv_init(void);
-#endif
-#ifdef CONFIG_I2C_BITVELLE
 	extern int i2c_bitvelle_init(void);
-#endif
-#ifdef CONFIG_I2C_BITVIA
 	extern int i2c_bitvia_init(void);
-#endif
-
-#ifdef CONFIG_I2C_ALGOPCF
 	extern int i2c_algo_pcf_init(void);	
-#endif
-#ifdef CONFIG_I2C_PCFISA
 	extern int i2c_pcfisa_init(void);
-#endif
 
 /* This is needed for automatic patch generation: sensors code starts here */
 /* This is needed for automatic patch generation: sensors code ends here   */
diff -urN linux-2.4.2-pre2/drivers/i2c/i2c-dev.c linux/drivers/i2c/i2c-dev.c
--- linux-2.4.2-pre2/drivers/i2c/i2c-dev.c	Fri Dec 29 14:35:47 2000
+++ linux/drivers/i2c/i2c-dev.c	Mon Dec  3 22:28:20 2001
@@ -34,7 +34,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/fs.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/version.h>
 #if LINUX_KERNEL_VERSION >= KERNEL_VERSION(2,4,0)
 #include <linux/smp_lock.h>
diff -urN linux-2.4.2-pre2/drivers/i2c/i2c-elektor.c linux/drivers/i2c/i2c-elektor.c
--- linux-2.4.2-pre2/drivers/i2c/i2c-elektor.c	Tue Jul 25 18:10:42 2000
+++ linux/drivers/i2c/i2c-elektor.c	Mon Dec  3 22:28:20 2001
@@ -28,7 +28,7 @@
 #include <linux/ioport.h>
 #include <linux/module.h>
 #include <linux/delay.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/version.h>
 #include <linux/init.h>
 #include <asm/irq.h>
diff -urN linux-2.4.2-pre2/drivers/i2c/i2c-elv.c linux/drivers/i2c/i2c-elv.c
--- linux-2.4.2-pre2/drivers/i2c/i2c-elv.c	Wed Feb  9 18:48:03 2000
+++ linux/drivers/i2c/i2c-elv.c	Mon Dec  3 22:28:20 2001
@@ -26,7 +26,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/delay.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/version.h>
 #include <linux/init.h>
 
diff -urN linux-2.4.2-pre2/drivers/i2c/i2c-pcf8584.h linux/drivers/i2c/i2c-pcf8584.h
--- linux-2.4.2-pre2/drivers/i2c/i2c-pcf8584.h	Fri Jan 28 19:36:23 2000
+++ linux/drivers/i2c/i2c-pcf8584.h	Mon Dec  3 22:28:20 2001
@@ -75,4 +75,4 @@
 #define I2C_PCF_INTREG	I2C_PCF_ES2
 #define I2C_PCF_CLKREG	I2C_PCF_ES1
 
-#endif I2C_PCF8584_H
+#endif /* I2C_PCF8584_H */
diff -urN linux-2.4.2-pre2/drivers/i2o/i2o_block.c linux/drivers/i2o/i2o_block.c
--- linux-2.4.2-pre2/drivers/i2o/i2o_block.c	Sun Jan 28 13:37:18 2001
+++ linux/drivers/i2o/i2o_block.c	Mon Dec  3 22:28:20 2001
@@ -51,7 +51,7 @@
 #include <linux/i2o.h>
 #include <linux/blkdev.h>
 #include <linux/blkpg.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/hdreg.h>
 
 #include <linux/notifier.h>
diff -urN linux-2.4.2-pre2/drivers/i2o/i2o_config.c linux/drivers/i2o/i2o_config.c
--- linux-2.4.2-pre2/drivers/i2o/i2o_config.c	Wed Jul 12 21:58:42 2000
+++ linux/drivers/i2o/i2o_config.c	Mon Dec  3 22:28:20 2001
@@ -31,7 +31,7 @@
 #include <linux/i2o.h>
 #include <linux/errno.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/miscdevice.h>
 #include <linux/mm.h>
 #include <linux/spinlock.h>
diff -urN linux-2.4.2-pre2/drivers/i2o/i2o_core.c linux/drivers/i2o/i2o_core.c
--- linux-2.4.2-pre2/drivers/i2o/i2o_core.c	Wed Nov  8 17:09:50 2000
+++ linux/drivers/i2o/i2o_core.c	Mon Dec  3 22:28:20 2001
@@ -31,7 +31,7 @@
 
 #include <linux/errno.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
 
diff -urN linux-2.4.2-pre2/drivers/i2o/i2o_lan.c linux/drivers/i2o/i2o_lan.c
--- linux-2.4.2-pre2/drivers/i2o/i2o_lan.c	Mon Dec 11 12:39:44 2000
+++ linux/drivers/i2o/i2o_lan.c	Mon Dec  3 22:28:20 2001
@@ -36,7 +36,7 @@
 
 #include <linux/skbuff.h>
 #include <linux/if_arp.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/tqueue.h>
diff -urN linux-2.4.2-pre2/drivers/i2o/i2o_pci.c linux/drivers/i2o/i2o_pci.c
--- linux-2.4.2-pre2/drivers/i2o/i2o_pci.c	Mon Jun 19 13:30:56 2000
+++ linux/drivers/i2o/i2o_pci.c	Mon Dec  3 22:28:20 2001
@@ -24,7 +24,7 @@
 #include <linux/i2o.h>
 #include <linux/errno.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <asm/io.h>
 
 #ifdef CONFIG_MTRR
diff -urN linux-2.4.2-pre2/drivers/ide/hd.c linux/drivers/ide/hd.c
--- linux-2.4.2-pre2/drivers/ide/hd.c	Thu Jan  4 12:50:17 2001
+++ linux/drivers/ide/hd.c	Mon Dec  3 22:28:20 2001
@@ -36,7 +36,7 @@
 #include <linux/kernel.h>
 #include <linux/hdreg.h>
 #include <linux/genhd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/ioport.h>
 #include <linux/mc146818rtc.h> /* CMOS defines */
diff -urN linux-2.4.2-pre2/drivers/ide/icside.c linux/drivers/ide/icside.c
--- linux-2.4.2-pre2/drivers/ide/icside.c	Tue Nov  7 11:02:24 2000
+++ linux/drivers/ide/icside.c	Mon Dec  3 22:28:20 2001
@@ -14,7 +14,7 @@
 #include <linux/string.h>
 #include <linux/module.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blkdev.h>
 #include <linux/errno.h>
 #include <linux/hdreg.h>
diff -urN linux-2.4.2-pre2/drivers/ide/ide-cd.c linux/drivers/ide/ide-cd.c
--- linux-2.4.2-pre2/drivers/ide/ide-cd.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/ide/ide-cd.c	Mon Dec  3 22:28:20 2001
@@ -302,7 +302,7 @@
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include <linux/timer.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/errno.h>
 #include <linux/cdrom.h>
diff -urN linux-2.4.2-pre2/drivers/ide/ide-cs.c linux/drivers/ide/ide-cs.c
--- linux-2.4.2-pre2/drivers/ide/ide-cs.c	Tue Jan  2 16:45:36 2001
+++ linux/drivers/ide/ide-cs.c	Mon Dec  3 22:28:20 2001
@@ -19,7 +19,7 @@
     are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
 
     Alternatively, the contents of this file may be used under the
-    terms of the GNU Public License version 2 (the "GPL"), in which
+    terms of the GNU General Public License version 2 (the "GPL"), in which
     case the provisions of the GPL are applicable instead of the
     above.  If you wish to allow the use of your version of this file
     only under the terms of the GPL and not to allow others to use
@@ -36,7 +36,7 @@
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/ioport.h>
@@ -95,7 +95,7 @@
 static int ide_event(event_t event, int priority,
 		     event_callback_args_t *args);
 
-static dev_info_t dev_info = "ide_cs";
+static dev_info_t dev_info = "ide-cs";
 
 static dev_link_t *ide_attach(void);
 static void ide_detach(dev_link_t *);
@@ -387,6 +387,11 @@
 	ide_unregister(info->hd);
 	MOD_DEC_USE_COUNT;
     }
+
+    request_region(link->io.BasePort1, link->io.NumPorts1,"ide-cs");
+    if (link->io.NumPorts2)
+	request_region(link->io.BasePort2, link->io.NumPorts2,"ide-cs");
+    
     info->ndev = 0;
     link->dev = NULL;
     
diff -urN linux-2.4.2-pre2/drivers/ide/ide-disk.c linux/drivers/ide/ide-disk.c
--- linux-2.4.2-pre2/drivers/ide/ide-disk.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/ide/ide-disk.c	Mon Dec  3 22:28:20 2001
@@ -44,7 +44,7 @@
 #include <linux/major.h>
 #include <linux/errno.h>
 #include <linux/genhd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/ide.h>
 
diff -urN linux-2.4.2-pre2/drivers/ide/ide-features.c linux/drivers/ide/ide-features.c
--- linux-2.4.2-pre2/drivers/ide/ide-features.c	Mon Oct 16 12:21:40 2000
+++ linux/drivers/ide/ide-features.c	Mon Dec  3 22:28:20 2001
@@ -27,7 +27,7 @@
 #include <linux/errno.h>
 #include <linux/genhd.h>
 #include <linux/blkpg.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/hdreg.h>
@@ -189,6 +189,10 @@
 	__cli();		/* local CPU only; some systems need this */
 	SELECT_MASK(HWIF(drive), drive, 0);
 	id = kmalloc(SECTOR_WORDS*4, GFP_ATOMIC);
+	if (!id) {
+		__restore_flags(flags);	/* local CPU only */
+		return 0;
+	}
 	ide_input_data(drive, id, SECTOR_WORDS);
 	(void) GET_STAT();	/* clear drive IRQ */
 	ide__sti();		/* local CPU only */
diff -urN linux-2.4.2-pre2/drivers/ide/ide-floppy.c linux/drivers/ide/ide-floppy.c
--- linux-2.4.2-pre2/drivers/ide/ide-floppy.c	Sun Dec 31 10:26:17 2000
+++ linux/drivers/ide/ide-floppy.c	Mon Dec  3 22:28:20 2001
@@ -45,7 +45,7 @@
 #include <linux/major.h>
 #include <linux/errno.h>
 #include <linux/genhd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/cdrom.h>
 #include <linux/ide.h>
 
diff -urN linux-2.4.2-pre2/drivers/ide/ide-probe.c linux/drivers/ide/ide-probe.c
--- linux-2.4.2-pre2/drivers/ide/ide-probe.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/ide/ide-probe.c	Mon Dec  3 22:28:20 2001
@@ -40,7 +40,7 @@
 #include <linux/major.h>
 #include <linux/errno.h>
 #include <linux/genhd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/ide.h>
 #include <linux/spinlock.h>
diff -urN linux-2.4.2-pre2/drivers/ide/ide-tape.c linux/drivers/ide/ide-tape.c
--- linux-2.4.2-pre2/drivers/ide/ide-tape.c	Sat Dec 30 18:16:13 2000
+++ linux/drivers/ide/ide-tape.c	Mon Dec  3 22:28:20 2001
@@ -399,7 +399,7 @@
 #include <linux/devfs_fs_kernel.h>
 #include <linux/errno.h>
 #include <linux/genhd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/ide.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.4.2-pre2/drivers/ide/ide.c linux/drivers/ide/ide.c
--- linux-2.4.2-pre2/drivers/ide/ide.c	Wed Dec  6 12:06:19 2000
+++ linux/drivers/ide/ide.c	Mon Dec  3 22:28:20 2001
@@ -140,7 +140,7 @@
 #include <linux/errno.h>
 #include <linux/genhd.h>
 #include <linux/blkpg.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #ifndef MODULE
 #include <linux/init.h>
 #endif /* MODULE */
diff -urN linux-2.4.2-pre2/drivers/ide/rapide.c linux/drivers/ide/rapide.c
--- linux-2.4.2-pre2/drivers/ide/rapide.c	Thu Apr 13 22:54:26 2000
+++ linux/drivers/ide/rapide.c	Mon Dec  3 22:28:20 2001
@@ -9,7 +9,7 @@
  */
 
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blkdev.h>
 #include <linux/errno.h>
 #include <linux/ide.h>
diff -urN linux-2.4.2-pre2/drivers/input/evdev.c linux/drivers/input/evdev.c
--- linux-2.4.2-pre2/drivers/input/evdev.c	Fri Nov 17 16:52:23 2000
+++ linux/drivers/input/evdev.c	Mon Dec  3 22:28:20 2001
@@ -33,7 +33,7 @@
 #define EVDEV_BUFFER_SIZE	64
 
 #include <linux/poll.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/input.h>
diff -urN linux-2.4.2-pre2/drivers/input/joydev.c linux/drivers/input/joydev.c
--- linux-2.4.2-pre2/drivers/input/joydev.c	Fri Nov 17 16:52:23 2000
+++ linux/drivers/input/joydev.c	Mon Dec  3 22:28:20 2001
@@ -38,7 +38,7 @@
 #include <linux/input.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/miscdevice.h>
 #include <linux/module.h>
diff -urN linux-2.4.2-pre2/drivers/input/keybdev.c linux/drivers/input/keybdev.c
--- linux-2.4.2-pre2/drivers/input/keybdev.c	Thu Jul 27 18:36:54 2000
+++ linux/drivers/input/keybdev.c	Mon Dec  3 22:28:20 2001
@@ -31,8 +31,9 @@
 #include <linux/config.h>
 #include <linux/kbd_ll.h>
 #include <linux/input.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
+#include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/kbd_kern.h>
 
diff -urN linux-2.4.2-pre2/drivers/input/mousedev.c linux/drivers/input/mousedev.c
--- linux-2.4.2-pre2/drivers/input/mousedev.c	Fri Nov 17 16:52:23 2000
+++ linux/drivers/input/mousedev.c	Mon Dec  3 22:28:20 2001
@@ -32,7 +32,7 @@
 #define MOUSEDEV_MINORS		32
 #define MOUSEDEV_MIX		31
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/poll.h>
 #include <linux/module.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/isdn/act2000/act2000.h linux/drivers/isdn/act2000/act2000.h
--- linux-2.4.2-pre2/drivers/isdn/act2000/act2000.h	Mon Dec 11 13:21:38 2000
+++ linux/drivers/isdn/act2000/act2000.h	Mon Dec  3 22:28:20 2001
@@ -88,7 +88,7 @@
 #include <asm/io.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
 #include <linux/ioport.h>
diff -urN linux-2.4.2-pre2/drivers/isdn/avmb1/avm_cs.c linux/drivers/isdn/avmb1/avm_cs.c
--- linux-2.4.2-pre2/drivers/isdn/avmb1/avm_cs.c	Mon Nov 27 16:53:43 2000
+++ linux/drivers/isdn/avmb1/avm_cs.c	Mon Dec  3 22:28:20 2001
@@ -11,7 +11,7 @@
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/tty.h>
diff -urN linux-2.4.2-pre2/drivers/isdn/avmb1/capi.c linux/drivers/isdn/avmb1/capi.c
--- linux-2.4.2-pre2/drivers/isdn/avmb1/capi.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/isdn/avmb1/capi.c	Mon Dec  3 22:28:20 2001
@@ -223,7 +223,7 @@
 #include <linux/kernel.h>
 #include <linux/major.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
 #include <linux/fs.h>
 #include <linux/signal.h>
diff -urN linux-2.4.2-pre2/drivers/isdn/avmb1/capidrv.c linux/drivers/isdn/avmb1/capidrv.c
--- linux-2.4.2-pre2/drivers/isdn/avmb1/capidrv.c	Mon Nov 27 16:53:43 2000
+++ linux/drivers/isdn/avmb1/capidrv.c	Mon Dec  3 22:28:20 2001
@@ -198,7 +198,7 @@
 #include <linux/kernel.h>
 #include <linux/major.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
 #include <linux/fs.h>
 #include <linux/signal.h>
diff -urN linux-2.4.2-pre2/drivers/isdn/avmb1/capifs.c linux/drivers/isdn/avmb1/capifs.c
--- linux-2.4.2-pre2/drivers/isdn/avmb1/capifs.c	Tue Nov 28 21:44:41 2000
+++ linux/drivers/isdn/avmb1/capifs.c	Mon Dec  3 22:28:20 2001
@@ -86,7 +86,7 @@
 #include <linux/kernel.h>
 #include <linux/locks.h>
 #include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ctype.h>
 #include <asm/bitops.h>
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/drivers/isdn/eicon/Divas_mod.c linux/drivers/isdn/eicon/Divas_mod.c
--- linux-2.4.2-pre2/drivers/isdn/eicon/Divas_mod.c	Wed Sep 27 13:45:40 2000
+++ linux/drivers/isdn/eicon/Divas_mod.c	Mon Dec  3 22:28:20 2001
@@ -34,7 +34,7 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <errno.h>
 
 #include "adapter.h"
diff -urN linux-2.4.2-pre2/drivers/isdn/eicon/eicon.h linux/drivers/isdn/eicon/eicon.h
--- linux-2.4.2-pre2/drivers/isdn/eicon/eicon.h	Sun Aug 13 10:05:32 2000
+++ linux/drivers/isdn/eicon/eicon.h	Mon Dec  3 22:28:20 2001
@@ -139,7 +139,7 @@
 #include <asm/io.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
 #include <linux/ioport.h>
diff -urN linux-2.4.2-pre2/drivers/isdn/eicon/linchr.c linux/drivers/isdn/eicon/linchr.c
--- linux-2.4.2-pre2/drivers/isdn/eicon/linchr.c	Sun Aug 13 10:05:32 2000
+++ linux/drivers/isdn/eicon/linchr.c	Mon Dec  3 22:28:20 2001
@@ -28,7 +28,7 @@
 #include <linux/kernel.h>
 #include <linux/poll.h>
 #include <linux/fs.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #undef N_DATA
 
diff -urN linux-2.4.2-pre2/drivers/isdn/eicon/linio.c linux/drivers/isdn/eicon/linio.c
--- linux-2.4.2-pre2/drivers/isdn/eicon/linio.c	Sun Aug 13 10:05:32 2000
+++ linux/drivers/isdn/eicon/linio.c	Mon Dec  3 22:28:20 2001
@@ -29,7 +29,7 @@
 
 #include <asm/io.h>
 #include <asm/system.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
 #undef N_DATA
diff -urN linux-2.4.2-pre2/drivers/isdn/hisax/hisax.h linux/drivers/isdn/hisax/hisax.h
--- linux-2.4.2-pre2/drivers/isdn/hisax/hisax.h	Fri Dec 29 14:07:22 2000
+++ linux/drivers/isdn/hisax/hisax.h	Mon Dec  3 22:28:20 2001
@@ -16,7 +16,7 @@
 #include <linux/delay.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
 #include <linux/ioport.h>
diff -urN linux-2.4.2-pre2/drivers/isdn/hysdn/hysdn_boot.c linux/drivers/isdn/hysdn/hysdn_boot.c
--- linux-2.4.2-pre2/drivers/isdn/hysdn/hysdn_boot.c	Fri Nov 17 11:16:20 2000
+++ linux/drivers/isdn/hysdn/hysdn_boot.c	Mon Dec  3 22:28:20 2001
@@ -26,7 +26,7 @@
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/vmalloc.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <asm/uaccess.h>
 
 #include "hysdn_defs.h"
diff -urN linux-2.4.2-pre2/drivers/isdn/hysdn/hysdn_init.c linux/drivers/isdn/hysdn/hysdn_init.c
--- linux-2.4.2-pre2/drivers/isdn/hysdn/hysdn_init.c	Tue Nov 28 21:44:41 2000
+++ linux/drivers/isdn/hysdn/hysdn_init.c	Mon Dec  3 22:28:20 2001
@@ -27,7 +27,7 @@
 #include <linux/version.h>
 #include <linux/poll.h>
 #include <linux/vmalloc.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pci.h>
 
 #include "hysdn_defs.h"
diff -urN linux-2.4.2-pre2/drivers/isdn/icn/icn.h linux/drivers/isdn/icn/icn.h
--- linux-2.4.2-pre2/drivers/isdn/icn/icn.h	Mon Dec 11 13:21:14 2000
+++ linux/drivers/isdn/icn/icn.h	Mon Dec  3 22:28:20 2001
@@ -55,7 +55,7 @@
 #include <asm/io.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
 #include <linux/ioport.h>
diff -urN linux-2.4.2-pre2/drivers/isdn/isdn_bsdcomp.c linux/drivers/isdn/isdn_bsdcomp.c
--- linux-2.4.2-pre2/drivers/isdn/isdn_bsdcomp.c	Sun Aug 15 11:49:08 1999
+++ linux/drivers/isdn/isdn_bsdcomp.c	Mon Dec  3 22:28:20 2001
@@ -61,7 +61,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/tty.h>
 #include <linux/errno.h>
 #include <linux/string.h>	/* used in new tty drivers */
diff -urN linux-2.4.2-pre2/drivers/isdn/isdn_v110.c linux/drivers/isdn/isdn_v110.c
--- linux-2.4.2-pre2/drivers/isdn/isdn_v110.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/isdn/isdn_v110.c	Mon Dec  3 22:28:20 2001
@@ -22,7 +22,7 @@
 
 #include <linux/string.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 
 #include <linux/isdn.h>
diff -urN linux-2.4.2-pre2/drivers/isdn/isdnloop/isdnloop.h linux/drivers/isdn/isdnloop/isdnloop.h
--- linux-2.4.2-pre2/drivers/isdn/isdnloop/isdnloop.h	Fri Nov 17 11:16:21 2000
+++ linux/drivers/isdn/isdnloop/isdnloop.h	Mon Dec  3 22:28:20 2001
@@ -53,7 +53,7 @@
 #include <asm/io.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
 #include <linux/ioport.h>
diff -urN linux-2.4.2-pre2/drivers/isdn/pcbit/callbacks.c linux/drivers/isdn/pcbit/callbacks.c
--- linux-2.4.2-pre2/drivers/isdn/pcbit/callbacks.c	Sun May 23 10:03:42 1999
+++ linux/drivers/isdn/pcbit/callbacks.c	Mon Dec  3 22:28:20 2001
@@ -27,7 +27,7 @@
 #include <linux/kernel.h>
 
 #include <linux/types.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/tqueue.h>
 #include <linux/skbuff.h>
diff -urN linux-2.4.2-pre2/drivers/isdn/pcbit/capi.c linux/drivers/isdn/pcbit/capi.c
--- linux-2.4.2-pre2/drivers/isdn/pcbit/capi.c	Mon Aug 21 07:49:03 2000
+++ linux/drivers/isdn/pcbit/capi.c	Mon Dec  3 22:28:20 2001
@@ -37,7 +37,7 @@
 #include <linux/kernel.h>
 
 #include <linux/types.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 
 #include <linux/tqueue.h>
diff -urN linux-2.4.2-pre2/drivers/isdn/pcbit/drv.c linux/drivers/isdn/pcbit/drv.c
--- linux-2.4.2-pre2/drivers/isdn/pcbit/drv.c	Fri Dec 29 14:07:22 2000
+++ linux/drivers/isdn/pcbit/drv.c	Mon Dec  3 22:28:20 2001
@@ -28,7 +28,7 @@
 #include <linux/kernel.h>
 
 #include <linux/types.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/interrupt.h>
 #include <linux/string.h>
diff -urN linux-2.4.2-pre2/drivers/isdn/pcbit/edss1.c linux/drivers/isdn/pcbit/edss1.c
--- linux-2.4.2-pre2/drivers/isdn/pcbit/edss1.c	Sat Aug 31 10:01:58 1996
+++ linux/drivers/isdn/pcbit/edss1.c	Mon Dec  3 22:28:20 2001
@@ -26,7 +26,7 @@
 #include <linux/kernel.h>
 
 #include <linux/types.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/tqueue.h>
 #include <linux/skbuff.h>
diff -urN linux-2.4.2-pre2/drivers/isdn/pcbit/layer2.c linux/drivers/isdn/pcbit/layer2.c
--- linux-2.4.2-pre2/drivers/isdn/pcbit/layer2.c	Mon Aug 21 07:49:03 2000
+++ linux/drivers/isdn/pcbit/layer2.c	Mon Dec  3 22:28:20 2001
@@ -40,7 +40,7 @@
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/tqueue.h>
 #include <linux/mm.h>
diff -urN linux-2.4.2-pre2/drivers/isdn/sc/includes.h linux/drivers/isdn/sc/includes.h
--- linux-2.4.2-pre2/drivers/isdn/sc/includes.h	Sun Jan 25 10:05:46 1998
+++ linux/drivers/isdn/sc/includes.h	Mon Dec  3 22:28:20 2001
@@ -5,7 +5,7 @@
 #include <asm/io.h>
 #include <linux/delay.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/ioport.h>
 #include <linux/timer.h>
diff -urN linux-2.4.2-pre2/drivers/macintosh/adb.c linux/drivers/macintosh/adb.c
--- linux-2.4.2-pre2/drivers/macintosh/adb.c	Sun Sep 17 09:48:05 2000
+++ linux/drivers/macintosh/adb.c	Mon Dec  3 22:28:20 2001
@@ -19,7 +19,7 @@
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/devfs_fs_kernel.h>
diff -urN linux-2.4.2-pre2/drivers/macintosh/adbhid.c linux/drivers/macintosh/adbhid.c
--- linux-2.4.2-pre2/drivers/macintosh/adbhid.c	Sun Sep 17 09:48:05 2000
+++ linux/drivers/macintosh/adbhid.c	Mon Dec  3 22:28:20 2001
@@ -33,7 +33,7 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/notifier.h>
 #include <linux/input.h>
diff -urN linux-2.4.2-pre2/drivers/macintosh/rtc.c linux/drivers/macintosh/rtc.c
--- linux-2.4.2-pre2/drivers/macintosh/rtc.c	Tue Sep 19 08:31:53 2000
+++ linux/drivers/macintosh/rtc.c	Mon Dec  3 22:28:20 2001
@@ -17,7 +17,7 @@
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
 #include <linux/poll.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/macintosh/via-pmu.c linux/drivers/macintosh/via-pmu.c
--- linux-2.4.2-pre2/drivers/macintosh/via-pmu.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/macintosh/via-pmu.c	Mon Dec  3 22:28:20 2001
@@ -26,7 +26,7 @@
 #include <linux/miscdevice.h>
 #include <linux/blkdev.h>
 #include <linux/pci.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/poll.h>
 #include <linux/adb.h>
 #include <linux/pmu.h>
diff -urN linux-2.4.2-pre2/drivers/macintosh/via-pmu68k.c linux/drivers/macintosh/via-pmu68k.c
--- linux-2.4.2-pre2/drivers/macintosh/via-pmu68k.c	Tue Feb 29 11:08:16 2000
+++ linux/drivers/macintosh/via-pmu68k.c	Mon Dec  3 22:28:20 2001
@@ -26,7 +26,7 @@
 #include <linux/miscdevice.h>
 #include <linux/blkdev.h>
 #include <linux/pci.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 
 #include <linux/adb.h>
diff -urN linux-2.4.2-pre2/drivers/md/linear.c linux/drivers/md/linear.c
--- linux-2.4.2-pre2/drivers/md/linear.c	Mon Dec 11 13:19:35 2000
+++ linux/drivers/md/linear.c	Mon Dec  3 22:28:20 2001
@@ -19,7 +19,7 @@
 #include <linux/module.h>
 
 #include <linux/raid/md.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <linux/raid/linear.h>
 
diff -urN linux-2.4.2-pre2/drivers/md/md.c linux/drivers/md/md.c
--- linux-2.4.2-pre2/drivers/md/md.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/md/md.c	Mon Dec  3 22:28:20 2001
@@ -61,6 +61,10 @@
 # define dprintk(x...) do { } while(0)
 #endif
 
+#ifndef MODULE
+static void autostart_arrays (void);
+#endif
+
 static mdk_personality_t *pers[MAX_PERSONALITY];
 
 /*
@@ -2030,70 +2034,6 @@
 #undef AUTOADDING
 #undef AUTORUNNING
 
-struct {
-	int set;
-	int noautodetect;
-} raid_setup_args md__initdata;
-
-void md_setup_drive (void) md__init;
-
-/*
- * Searches all registered partitions for autorun RAID arrays
- * at boot time.
- */
-static int detected_devices[128] md__initdata;
-static int dev_cnt;
-
-void md_autodetect_dev(kdev_t dev)
-{
-	if (dev_cnt >= 0 && dev_cnt < 127)
-		detected_devices[dev_cnt++] = dev;
-}
-
-
-static void autostart_arrays (void)
-{
-	mdk_rdev_t *rdev;
-	int i;
-
-	printk(KERN_INFO "autodetecting RAID arrays\n");
-
-	for (i=0; i<dev_cnt; i++) {
-		kdev_t dev = detected_devices[i];
-
-		if (md_import_device(dev,1)) {
-			printk(KERN_ALERT "could not import %s!\n",
-			       partition_name(dev));
-			continue;
-		}
-		/*
-		 * Sanity checks:
-		 */
-		rdev = find_rdev_all(dev);
-		if (!rdev) {
-			MD_BUG();
-			continue;
-		}
-		if (rdev->faulty) {
-			MD_BUG();
-			continue;
-		}
-		md_list_add(&rdev->pending, &pending_raid_disks);
-	}
-
-	autorun_devices(-1);
-}
-
-int md__init md_run_setup(void)
-{
-	if (raid_setup_args.noautodetect)
-		printk(KERN_INFO "skipping autodetection of RAID arrays\n");
-	else
-		autostart_arrays();
-	dev_cnt = -1; /* make sure further calls to md_autodetect_dev are ignored */
-	md_setup_drive();
-	return 0;
-}
 
 static int get_version (void * arg)
 {
@@ -2555,10 +2495,12 @@
 			md_print_devices();
 			goto done_unlock;
 
+#ifndef MODULE
 		case RAID_AUTORUN:
 			err = 0;
 			autostart_arrays();
 			goto done;
+#endif
 
 		case BLKGETSIZE:   /* Return device size */
 			if (!arg) {
@@ -3556,30 +3498,7 @@
 	NULL,
 	0
 };
-#ifndef MODULE
-static int md__init raid_setup(char *str)
-{
-	int len, pos;
 
-	len = strlen(str) + 1;
-	pos = 0;
-
-	while (pos < len) {
-		char *comma = strchr(str+pos, ',');
-		int wlen;
-		if (comma)
-			wlen = (comma-str)-pos;
-		else	wlen = (len-1)-pos;
-
-		if (strncmp(str, "noautodetect", wlen) == 0)
-			raid_setup_args.noautodetect = 1;
-		pos += wlen+1;
-	}
-	raid_setup_args.set = 1;
-	return 1;
-}
-__setup("raid=", raid_setup);
-#endif
 static void md_geninit (void)
 {
 	int i;
@@ -3641,6 +3560,70 @@
 	return (0);
 }
 
+
+#ifndef MODULE
+
+/*
+ * When md (and any require personalities) are compiled into the kernel
+ * (not a module), arrays can be assembles are boot time using with AUTODETECT
+ * where specially marked partitions are registered with md_autodetect_dev(),
+ * and with MD_BOOT where devices to be collected are given on the boot line
+ * with md=.....
+ * The code for that is here.
+ */
+
+struct {
+	int set;
+	int noautodetect;
+} raid_setup_args md__initdata;
+
+/*
+ * Searches all registered partitions for autorun RAID arrays
+ * at boot time.
+ */
+static int detected_devices[128] md__initdata;
+static int dev_cnt;
+
+void md_autodetect_dev(kdev_t dev)
+{
+	if (dev_cnt >= 0 && dev_cnt < 127)
+		detected_devices[dev_cnt++] = dev;
+}
+
+
+static void autostart_arrays (void)
+{
+	mdk_rdev_t *rdev;
+	int i;
+
+	printk(KERN_INFO "autodetecting RAID arrays\n");
+
+	for (i=0; i<dev_cnt; i++) {
+		kdev_t dev = detected_devices[i];
+
+		if (md_import_device(dev,1)) {
+			printk(KERN_ALERT "could not import %s!\n",
+			       partition_name(dev));
+			continue;
+		}
+		/*
+		 * Sanity checks:
+		 */
+		rdev = find_rdev_all(dev);
+		if (!rdev) {
+			MD_BUG();
+			continue;
+		}
+		if (rdev->faulty) {
+			MD_BUG();
+			continue;
+		}
+		md_list_add(&rdev->pending, &pending_raid_disks);
+	}
+
+	autorun_devices(-1);
+}
+
 static struct {
 	char device_set [MAX_MD_DEVS];
 	int pers[MAX_MD_DEVS];
@@ -3809,9 +3792,47 @@
 	}
 }
 
+static int md__init raid_setup(char *str)
+{
+	int len, pos;
+
+	len = strlen(str) + 1;
+	pos = 0;
+
+	while (pos < len) {
+		char *comma = strchr(str+pos, ',');
+		int wlen;
+		if (comma)
+			wlen = (comma-str)-pos;
+		else	wlen = (len-1)-pos;
+
+		if (strncmp(str, "noautodetect", wlen) == 0)
+			raid_setup_args.noautodetect = 1;
+		pos += wlen+1;
+	}
+	raid_setup_args.set = 1;
+	return 1;
+}
+
+int md__init md_run_setup(void)
+{
+	if (raid_setup_args.noautodetect)
+		printk(KERN_INFO "skipping autodetection of RAID arrays\n");
+	else
+		autostart_arrays();
+	dev_cnt = -1; /* make sure further calls to md_autodetect_dev are ignored */
+	md_setup_drive();
+	return 0;
+}
+
+__setup("raid=", raid_setup);
 __setup("md=", md_setup);
 
-#ifdef MODULE
+__initcall(md_init);
+__initcall(md_run_setup);
+
+#else /* It is a MODULE */
+
 int init_module (void)
 {
 	return md_init();
@@ -3859,9 +3880,6 @@
 
 }
 #endif
-
-__initcall(md_init);
-__initcall(md_run_setup);
 
 MD_EXPORT_SYMBOL(md_size);
 MD_EXPORT_SYMBOL(register_md_personality);
diff -urN linux-2.4.2-pre2/drivers/md/raid1.c linux/drivers/md/raid1.c
--- linux-2.4.2-pre2/drivers/md/raid1.c	Mon Dec 11 13:19:35 2000
+++ linux/drivers/md/raid1.c	Mon Dec  3 22:28:20 2001
@@ -23,7 +23,7 @@
  */
 
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/raid/raid1.h>
 #include <asm/atomic.h>
 
diff -urN linux-2.4.2-pre2/drivers/md/raid5.c linux/drivers/md/raid5.c
--- linux-2.4.2-pre2/drivers/md/raid5.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/md/raid5.c	Mon Dec  3 22:28:20 2001
@@ -19,7 +19,7 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/locks.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/raid/raid5.h>
 #include <asm/bitops.h>
 #include <asm/atomic.h>
@@ -381,7 +381,7 @@
 		if (bh == sh->bh_cache[i])
 			break;
 
-	PRINTK("end_read_request %lu/%d,  %d, count: %d, uptodate %d.\n", sh->sector, i, atomic_read(&sh->count), uptodate);
+	PRINTK("end_read_request %lu/%d, count: %d, uptodate %d.\n", sh->sector, i, atomic_read(&sh->count), uptodate);
 	if (i == disks) {
 		BUG();
 		return;
@@ -680,7 +680,6 @@
 
 	count = 1;
 	bh_ptr[0] = sh->bh_cache[pd_idx];
-	spin_lock_irq(&conf->device_lock);
 	switch(method) {
 	case READ_MODIFY_WRITE:
 		if (!buffer_uptodate(sh->bh_cache[pd_idx]))
@@ -707,13 +706,11 @@
 				sh->bh_write[i] = sh->bh_write[i]->b_reqnext;
 				chosen[i]->b_reqnext = sh->bh_written[i];
 				sh->bh_written[i] = chosen[i];
-				check_xor();
 			}
 		break;
 	case CHECK_PARITY:
 		break;
 	}
-	spin_unlock_irq(&conf->device_lock);
 	if (count>1) {
 		xor_block(count, bh_ptr);
 		count = 1;
@@ -723,7 +720,6 @@
 		if (chosen[i]) {
 			struct buffer_head *bh = sh->bh_cache[i];
 			char *bdata;
-			mark_buffer_clean(chosen[i]); /* NO FIXME */
 			bdata = bh_kmap(chosen[i]);
 			memcpy(bh->b_data,
 			       bdata,sh->size);
@@ -766,6 +762,7 @@
 	PRINTK("adding bh b#%lu to stripe s#%lu\n", bh->b_blocknr, sh->sector);
 
 
+	spin_lock(&sh->lock);
 	spin_lock_irq(&conf->device_lock);
 	bh->b_reqnext = NULL;
 	if (rw == READ)
@@ -778,6 +775,7 @@
 	}
 	*bhp = bh;
 	spin_unlock_irq(&conf->device_lock);
+	spin_unlock(&sh->lock);
 
 	PRINTK("added bh b#%lu to stripe s#%lu, disk %d.\n", bh->b_blocknr, sh->sector, dd_idx);
 }
@@ -827,7 +825,7 @@
 
 	for (i=disks; i--; ) {
 		bh = sh->bh_cache[i];
-		PRINTK("check %d: state %lx read %p write %p written %p\n", i, bh->b_state, sh->bh_read[i], sh->bh_write[i], sh->bh_written[i]);
+		PRINTK("check %d: state 0x%lx read %p write %p written %p\n", i, bh->b_state, sh->bh_read[i], sh->bh_write[i], sh->bh_written[i]);
 		/* maybe we can reply to a read */
 		if (buffer_uptodate(bh) && sh->bh_read[i]) {
 			struct buffer_head *rbh, *rbh2;
@@ -867,7 +865,6 @@
 	 * need to be failed
 	 */
 	if (failed > 1 && to_read+to_write) {
-		spin_lock_irq(&conf->device_lock);
 		for (i=disks; i--; ) {
 			/* fail all writes first */
 			if (sh->bh_write[i]) to_write--;
@@ -878,15 +875,16 @@
 			}
 			/* fail any reads if this device is non-operational */
 			if (!conf->disks[i].operational) {
+				spin_lock_irq(&conf->device_lock);
 				if (sh->bh_read[i]) to_read--;
 				while ((bh = sh->bh_read[i])) {
 					sh->bh_read[i] = bh->b_reqnext;
 					bh->b_reqnext = return_fail;
 					return_fail = bh;
 				}
+				spin_unlock_irq(&conf->device_lock);
 			}
 		}
-		spin_unlock_irq(&conf->device_lock);
 		if (syncing) {
 			md_done_sync(conf->mddev, (sh->size>>10) - sh->sync_redone,0);
 			clear_bit(STRIPE_SYNCING, &sh->state);
@@ -911,10 +909,8 @@
 			/* maybe we can return some write requests */
 			struct buffer_head *wbh, *wbh2;
 			PRINTK("Return write for disc %d\n", i);
-			spin_lock_irq(&conf->device_lock);
 			wbh = sh->bh_written[i];
 			sh->bh_written[i] = NULL;
-			spin_unlock_irq(&conf->device_lock);
 			while (wbh) {
 			    wbh2 = wbh->b_reqnext;
 			    wbh->b_reqnext = return_ok;
@@ -1092,8 +1088,6 @@
 				bh->b_dev = conf->disks[i].dev;
 			else if (conf->spare && action[i] == WRITE+1)
 				bh->b_dev = conf->spare->dev;
-			else if (action[i] == READ+1)
-				BUG();
 			else skip=1;
 			if (!skip) {
 				PRINTK("for %ld schedule op %d on disc %d\n", sh->sector, action[i]-1, i);
diff -urN linux-2.4.2-pre2/drivers/media/video/bttv-driver.c linux/drivers/media/video/bttv-driver.c
--- linux-2.4.2-pre2/drivers/media/video/bttv-driver.c	Sat Dec 30 11:23:13 2000
+++ linux/drivers/media/video/bttv-driver.c	Mon Dec  3 22:28:20 2001
@@ -27,7 +27,7 @@
 #include <linux/fs.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/poll.h>
 #include <linux/pci.h>
diff -urN linux-2.4.2-pre2/drivers/media/video/buz.c linux/drivers/media/video/buz.c
--- linux-2.4.2-pre2/drivers/media/video/buz.c	Fri Nov 17 17:56:51 2000
+++ linux/drivers/media/video/buz.c	Mon Dec  3 22:28:20 2001
@@ -36,7 +36,7 @@
 #include <linux/fs.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/pci.h>
 #include <linux/signal.h>
diff -urN linux-2.4.2-pre2/drivers/media/video/bw-qcam.c linux/drivers/media/video/bw-qcam.c
--- linux-2.4.2-pre2/drivers/media/video/bw-qcam.c	Mon Nov 27 17:47:38 2000
+++ linux/drivers/media/video/bw-qcam.c	Mon Dec  3 22:28:20 2001
@@ -70,7 +70,7 @@
 #include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/parport.h>
 #include <linux/sched.h>
diff -urN linux-2.4.2-pre2/drivers/media/video/c-qcam.c linux/drivers/media/video/c-qcam.c
--- linux-2.4.2-pre2/drivers/media/video/c-qcam.c	Mon Nov 27 17:47:38 2000
+++ linux/drivers/media/video/c-qcam.c	Mon Dec  3 22:28:20 2001
@@ -29,7 +29,7 @@
 #include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/parport.h>
 #include <linux/sched.h>
diff -urN linux-2.4.2-pre2/drivers/media/video/i2c-old.c linux/drivers/media/video/i2c-old.c
--- linux-2.4.2-pre2/drivers/media/video/i2c-old.c	Mon Aug 14 11:56:53 2000
+++ linux/drivers/media/video/i2c-old.c	Mon Dec  3 22:28:20 2001
@@ -14,7 +14,7 @@
 #include <linux/delay.h>
 #include <linux/locks.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/i2c-old.h>
 
 #define REGPRINT(x)   if (verbose)   (x)
diff -urN linux-2.4.2-pre2/drivers/media/video/msp3400.c linux/drivers/media/video/msp3400.c
--- linux-2.4.2-pre2/drivers/media/video/msp3400.c	Sun Dec  3 17:45:22 2000
+++ linux/drivers/media/video/msp3400.c	Mon Dec  3 22:28:20 2001
@@ -42,7 +42,7 @@
 #include <linux/timer.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/i2c.h>
 #include <linux/videodev.h>
 #include <asm/semaphore.h>
diff -urN linux-2.4.2-pre2/drivers/media/video/planb.c linux/drivers/media/video/planb.c
--- linux-2.4.2-pre2/drivers/media/video/planb.c	Fri Nov 17 17:56:51 2000
+++ linux/drivers/media/video/planb.c	Mon Dec  3 22:28:20 2001
@@ -33,7 +33,7 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
diff -urN linux-2.4.2-pre2/drivers/media/video/pms.c linux/drivers/media/video/pms.c
--- linux-2.4.2-pre2/drivers/media/video/pms.c	Fri Nov 17 17:56:51 2000
+++ linux/drivers/media/video/pms.c	Mon Dec  3 22:28:20 2001
@@ -19,7 +19,7 @@
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/media/video/saa7111.c linux/drivers/media/video/saa7111.c
--- linux-2.4.2-pre2/drivers/media/video/saa7111.c	Wed Dec 29 17:08:55 1999
+++ linux/drivers/media/video/saa7111.c	Mon Dec  3 22:28:20 2001
@@ -24,7 +24,7 @@
 #include <linux/fs.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/pci.h>
 #include <linux/signal.h>
diff -urN linux-2.4.2-pre2/drivers/media/video/saa7185.c linux/drivers/media/video/saa7185.c
--- linux-2.4.2-pre2/drivers/media/video/saa7185.c	Wed Dec 29 17:08:55 1999
+++ linux/drivers/media/video/saa7185.c	Mon Dec  3 22:28:20 2001
@@ -24,7 +24,7 @@
 #include <linux/fs.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/pci.h>
 #include <linux/signal.h>
diff -urN linux-2.4.2-pre2/drivers/media/video/stradis.c linux/drivers/media/video/stradis.c
--- linux-2.4.2-pre2/drivers/media/video/stradis.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/media/video/stradis.c	Mon Dec  3 22:28:20 2001
@@ -26,7 +26,7 @@
 #include <linux/fs.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/poll.h>
diff -urN linux-2.4.2-pre2/drivers/media/video/tda7432.c linux/drivers/media/video/tda7432.c
--- linux-2.4.2-pre2/drivers/media/video/tda7432.c	Sun Nov 12 20:47:19 2000
+++ linux/drivers/media/video/tda7432.c	Mon Dec  3 22:28:20 2001
@@ -34,7 +34,7 @@
 #include <linux/timer.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/videodev.h>
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
diff -urN linux-2.4.2-pre2/drivers/media/video/tda9875.c linux/drivers/media/video/tda9875.c
--- linux-2.4.2-pre2/drivers/media/video/tda9875.c	Sun Nov 12 20:47:19 2000
+++ linux/drivers/media/video/tda9875.c	Mon Dec  3 22:28:20 2001
@@ -24,7 +24,7 @@
 #include <linux/timer.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/videodev.h>
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
diff -urN linux-2.4.2-pre2/drivers/media/video/tuner-3036.c linux/drivers/media/video/tuner-3036.c
--- linux-2.4.2-pre2/drivers/media/video/tuner-3036.c	Mon Feb 28 14:56:10 2000
+++ linux/drivers/media/video/tuner-3036.c	Mon Dec  3 22:28:20 2001
@@ -20,7 +20,7 @@
 #include <linux/timer.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/version.h>
 #include <linux/init.h>
 
diff -urN linux-2.4.2-pre2/drivers/media/video/tuner.c linux/drivers/media/video/tuner.c
--- linux-2.4.2-pre2/drivers/media/video/tuner.c	Sun Nov 12 20:47:19 2000
+++ linux/drivers/media/video/tuner.c	Mon Dec  3 22:28:20 2001
@@ -5,7 +5,7 @@
 #include <linux/timer.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/poll.h>
 #include <linux/i2c.h>
 #include <linux/types.h>
diff -urN linux-2.4.2-pre2/drivers/media/video/tvaudio.c linux/drivers/media/video/tvaudio.c
--- linux-2.4.2-pre2/drivers/media/video/tvaudio.c	Tue Dec  5 12:43:47 2000
+++ linux/drivers/media/video/tvaudio.c	Mon Dec  3 22:28:20 2001
@@ -22,7 +22,7 @@
 #include <linux/timer.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/videodev.h>
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
diff -urN linux-2.4.2-pre2/drivers/media/video/tvmixer.c linux/drivers/media/video/tvmixer.c
--- linux-2.4.2-pre2/drivers/media/video/tvmixer.c	Sun Nov 12 20:47:19 2000
+++ linux/drivers/media/video/tvmixer.c	Mon Dec  3 22:28:20 2001
@@ -5,7 +5,7 @@
 #include <linux/timer.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/i2c.h>
 #include <linux/videodev.h>
 #include <asm/semaphore.h>
diff -urN linux-2.4.2-pre2/drivers/media/video/zr36120.c linux/drivers/media/video/zr36120.c
--- linux-2.4.2-pre2/drivers/media/video/zr36120.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/media/video/zr36120.c	Mon Dec  3 22:28:20 2001
@@ -25,7 +25,7 @@
 #include <linux/fs.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/mm.h>
 #include <linux/pci.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/cfi_cmdset_0001.c linux/drivers/mtd/cfi_cmdset_0001.c
--- linux-2.4.2-pre2/drivers/mtd/cfi_cmdset_0001.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/mtd/cfi_cmdset_0001.c	Mon Dec  3 22:28:20 2001
@@ -15,7 +15,7 @@
 #include <asm/byteorder.h>
 
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/cfi.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/cfi_cmdset_0002.c linux/drivers/mtd/cfi_cmdset_0002.c
--- linux-2.4.2-pre2/drivers/mtd/cfi_cmdset_0002.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/mtd/cfi_cmdset_0002.c	Mon Dec  3 22:28:20 2001
@@ -18,7 +18,7 @@
 #include <asm/byteorder.h>
 
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/mtd/map.h>
 #include <linux/mtd/cfi.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/cfi_probe.c linux/drivers/mtd/cfi_probe.c
--- linux-2.4.2-pre2/drivers/mtd/cfi_probe.c	Sun Dec 31 10:26:17 2000
+++ linux/drivers/mtd/cfi_probe.c	Mon Dec  3 22:28:20 2001
@@ -11,7 +11,7 @@
 #include <asm/io.h>
 #include <asm/byteorder.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <linux/mtd/map.h>
 #include <linux/mtd/cfi.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/doc1000.c linux/drivers/mtd/doc1000.c
--- linux-2.4.2-pre2/drivers/mtd/doc1000.c	Sun Dec  3 17:45:22 2000
+++ linux/drivers/mtd/doc1000.c	Mon Dec  3 22:28:20 2001
@@ -12,7 +12,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/major.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/doc2000.c linux/drivers/mtd/doc2000.c
--- linux-2.4.2-pre2/drivers/mtd/doc2000.c	Mon Dec 11 14:57:58 2000
+++ linux/drivers/mtd/doc2000.c	Mon Dec  3 22:28:20 2001
@@ -15,7 +15,7 @@
 #include <linux/miscdevice.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/types.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/doc2001.c linux/drivers/mtd/doc2001.c
--- linux-2.4.2-pre2/drivers/mtd/doc2001.c	Mon Dec 11 14:57:58 2000
+++ linux/drivers/mtd/doc2001.c	Mon Dec  3 22:28:20 2001
@@ -15,7 +15,7 @@
 #include <linux/miscdevice.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/types.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/docecc.c linux/drivers/mtd/docecc.c
--- linux-2.4.2-pre2/drivers/mtd/docecc.c	Mon Dec 11 14:57:58 2000
+++ linux/drivers/mtd/docecc.c	Mon Dec  3 22:28:20 2001
@@ -31,7 +31,7 @@
 #include <linux/miscdevice.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/types.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/docprobe.c linux/drivers/mtd/docprobe.c
--- linux-2.4.2-pre2/drivers/mtd/docprobe.c	Fri Dec 29 14:07:22 2000
+++ linux/drivers/mtd/docprobe.c	Mon Dec  3 22:28:20 2001
@@ -50,7 +50,7 @@
 #include <linux/miscdevice.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/types.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/ftl.c linux/drivers/mtd/ftl.c
--- linux-2.4.2-pre2/drivers/mtd/ftl.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/mtd/ftl.c	Mon Dec  3 22:28:20 2001
@@ -68,7 +68,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/major.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/map_ram.c linux/drivers/mtd/map_ram.c
--- linux-2.4.2-pre2/drivers/mtd/map_ram.c	Mon Dec 11 14:57:58 2000
+++ linux/drivers/mtd/map_ram.c	Mon Dec  3 22:28:20 2001
@@ -10,7 +10,7 @@
 #include <asm/io.h>
 #include <asm/byteorder.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <linux/mtd/map.h>
 
diff -urN linux-2.4.2-pre2/drivers/mtd/map_rom.c linux/drivers/mtd/map_rom.c
--- linux-2.4.2-pre2/drivers/mtd/map_rom.c	Mon Dec 11 14:57:58 2000
+++ linux/drivers/mtd/map_rom.c	Mon Dec  3 22:28:20 2001
@@ -10,7 +10,7 @@
 #include <asm/io.h>
 #include <asm/byteorder.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <linux/mtd/map.h>
 
diff -urN linux-2.4.2-pre2/drivers/mtd/mixmem.c linux/drivers/mtd/mixmem.c
--- linux-2.4.2-pre2/drivers/mtd/mixmem.c	Tue Jul  4 10:10:05 2000
+++ linux/drivers/mtd/mixmem.c	Mon Dec  3 22:28:20 2001
@@ -11,7 +11,7 @@
  */
 
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <asm/io.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/mtdblock.c linux/drivers/mtd/mtdblock.c
--- linux-2.4.2-pre2/drivers/mtd/mtdblock.c	Fri Dec 29 14:07:22 2000
+++ linux/drivers/mtd/mtdblock.c	Mon Dec  3 22:28:20 2001
@@ -10,7 +10,7 @@
 #include <linux/types.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mtd/mtd.h>
 
 #define MAJOR_NR MTD_BLOCK_MAJOR
diff -urN linux-2.4.2-pre2/drivers/mtd/mtdchar.c linux/drivers/mtd/mtdchar.c
--- linux-2.4.2-pre2/drivers/mtd/mtdchar.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/mtd/mtdchar.c	Mon Dec  3 22:28:20 2001
@@ -12,7 +12,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/mtd/mtd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #ifdef CONFIG_DEVFS_FS
 #include <linux/devfs_fs_kernel.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/mtdcore.c linux/drivers/mtd/mtdcore.c
--- linux-2.4.2-pre2/drivers/mtd/mtdcore.c	Mon Dec 11 14:57:58 2000
+++ linux/drivers/mtd/mtdcore.c	Mon Dec  3 22:28:20 2001
@@ -11,7 +11,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/major.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/mtdpart.c linux/drivers/mtd/mtdpart.c
--- linux-2.4.2-pre2/drivers/mtd/mtdpart.c	Mon Dec 11 14:57:58 2000
+++ linux/drivers/mtd/mtdpart.c	Mon Dec  3 22:28:20 2001
@@ -11,7 +11,7 @@
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/list.h>
 
 #include <linux/mtd/mtd.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/mtdram.c linux/drivers/mtd/mtdram.c
--- linux-2.4.2-pre2/drivers/mtd/mtdram.c	Tue Jul 18 15:03:56 2000
+++ linux/drivers/mtd/mtdram.c	Mon Dec  3 22:28:20 2001
@@ -12,7 +12,7 @@
 #include <linux/config.h>
 #include <linux/module.h>
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/mtd/compatmac.h>
 #include <linux/mtd/mtd.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/nftl.c linux/drivers/mtd/nftl.c
--- linux-2.4.2-pre2/drivers/mtd/nftl.c	Mon Dec 11 14:57:58 2000
+++ linux/drivers/mtd/nftl.c	Mon Dec  3 22:28:20 2001
@@ -63,7 +63,7 @@
 #include <linux/miscdevice.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/blkpg.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/nftlmount.c linux/drivers/mtd/nftlmount.c
--- linux-2.4.2-pre2/drivers/mtd/nftlmount.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/mtd/nftlmount.c	Mon Dec  3 22:28:20 2001
@@ -28,7 +28,7 @@
 #include <linux/miscdevice.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/mtd/mtd.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/octagon-5066.c linux/drivers/mtd/octagon-5066.c
--- linux-2.4.2-pre2/drivers/mtd/octagon-5066.c	Mon Dec 11 14:57:58 2000
+++ linux/drivers/mtd/octagon-5066.c	Mon Dec  3 22:28:20 2001
@@ -25,7 +25,7 @@
    ##################################################################### */
 
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
 #include <asm/io.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/pmc551.c linux/drivers/mtd/pmc551.c
--- linux-2.4.2-pre2/drivers/mtd/pmc551.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/mtd/pmc551.c	Mon Dec  3 22:28:20 2001
@@ -78,7 +78,7 @@
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/major.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/slram.c linux/drivers/mtd/slram.c
--- linux-2.4.2-pre2/drivers/mtd/slram.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/mtd/slram.c	Mon Dec  3 22:28:20 2001
@@ -11,7 +11,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/major.h>
diff -urN linux-2.4.2-pre2/drivers/mtd/vmax301.c linux/drivers/mtd/vmax301.c
--- linux-2.4.2-pre2/drivers/mtd/vmax301.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/mtd/vmax301.c	Mon Dec  3 22:28:20 2001
@@ -17,7 +17,7 @@
    ##################################################################### */
 
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
 #include <asm/spinlock.h>
diff -urN linux-2.4.2-pre2/drivers/net/3c523.c linux/drivers/net/3c523.c
--- linux-2.4.2-pre2/drivers/net/3c523.c	Sat Dec 30 11:23:13 2000
+++ linux/drivers/net/3c523.c	Mon Dec  3 22:28:20 2001
@@ -3,7 +3,7 @@
 
 
    This is an extension to the Linux operating system, and is covered by the
-   same Gnu Public License that covers that work.
+   same GNU General Public License that covers that work.
 
    Copyright 1995, 1996 by Chris Beauregard (cpbeaure@undergrad.math.uwaterloo.ca)
 
@@ -91,7 +91,7 @@
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/mca.h>
@@ -148,9 +148,9 @@
 
 #define RECV_BUFF_SIZE 1524	/* slightly oversized */
 #define XMIT_BUFF_SIZE 1524	/* slightly oversized */
-#define NUM_XMIT_BUFFS 4	/* config for both, 8K and 16K shmem */
-#define NUM_RECV_BUFFS_8  1	/* config for 8K shared mem */
-#define NUM_RECV_BUFFS_16 6	/* config for 16K shared mem */
+#define NUM_XMIT_BUFFS 1	/* config for both, 8K and 16K shmem */
+#define NUM_RECV_BUFFS_8  4	/* config for 8K shared mem */
+#define NUM_RECV_BUFFS_16 9	/* config for 16K shared mem */
 
 #if (NUM_XMIT_BUFFS == 1)
 #define NO_NOPCOMMANDS		/* only possible with NUM_XMIT_BUFFS=1 */
@@ -197,6 +197,7 @@
 	struct net_device_stats stats;
 	unsigned long base;
 	char *memtop;
+	unsigned long mapped_start;		/* Start of ioremap */
 	volatile struct rfd_struct *rfd_last, *rfd_top, *rfd_first;
 	volatile struct scp_struct *scp;	/* volatile is important */
 	volatile struct iscp_struct *iscp;	/* volatile is important */
@@ -303,13 +304,13 @@
 	char *iscp_addrs[2];
 	int i = 0;
 
-	p->base = where + size - 0x01000000;
-	p->memtop = phys_to_virt(where) + size;
-	p->scp = (struct scp_struct *)phys_to_virt(p->base + SCP_DEFAULT_ADDRESS);
+	p->base = (unsigned long) bus_to_virt((unsigned long)where) + size - 0x01000000;
+	p->memtop = bus_to_virt((unsigned long)where) + size;
+	p->scp = (struct scp_struct *)(p->base + SCP_DEFAULT_ADDRESS);
 	memset((char *) p->scp, 0, sizeof(struct scp_struct));
 	p->scp->sysbus = SYSBUSVAL;	/* 1 = 8Bit-Bus, 0 = 16 Bit */
 
-	iscp_addrs[0] = phys_to_virt(where);
+	iscp_addrs[0] = bus_to_virt((unsigned long)where);
 	iscp_addrs[1] = (char *) p->scp - sizeof(struct iscp_struct);
 
 	for (i = 0; i < 2; i++) {
@@ -325,6 +326,7 @@
 
 		/* apparently, you sometimes have to kick the 82586 twice... */
 		elmc_id_attn586();
+		DELAY(1);
 
 		if (p->iscp->busy) {	/* i82586 clears 'busy' after successful init */
 			return 0;
@@ -344,8 +346,8 @@
 	elmc_id_reset586();
 	DELAY(2);
 
-	p->scp = (struct scp_struct *) phys_to_virt(p->base + SCP_DEFAULT_ADDRESS);
-	p->scb = (struct scb_struct *) phys_to_virt(dev->mem_start);
+	p->scp = (struct scp_struct *) (p->base + SCP_DEFAULT_ADDRESS);
+	p->scb = (struct scb_struct *) bus_to_virt(dev->mem_start);
 	p->iscp = (struct iscp_struct *) ((char *) p->scp - sizeof(struct iscp_struct));
 
 	memset((char *) p->iscp, 0, sizeof(struct iscp_struct));
@@ -409,6 +411,8 @@
 	u_char revision = 0;
 	int i = 0;
 	unsigned int size = 0;
+	int retval;
+	struct priv *pr;
 
 	SET_MODULE_OWNER(dev);
 	if (MCA_bus == 0) {
@@ -428,18 +432,24 @@
 		   Also reject it if the card is already in use.
 		 */
 
-		if((irq && irq != dev->irq) || (base_addr && base_addr != dev->base_addr)
-		   || check_region(dev->base_addr,ELMC_IO_EXTENT)) {
+		if ((irq && irq != dev->irq) || 
+		    (base_addr && base_addr != dev->base_addr)) {
 			slot = mca_find_adapter(ELMC_MCA_ID, slot + 1);
 			continue;
 		}
+		if (!request_region(dev->base_addr, ELMC_IO_EXTENT, dev->name)) {
+			slot = mca_find_adapter(ELMC_MCA_ID, slot + 1);
+			continue;
+		}
+
 		/* found what we're looking for... */
 		break;
 	}
 
 	/* we didn't find any 3c523 in the slots we checked for */
 	if (slot == MCA_NOTFOUND) {
-		return ((base_addr || irq) ? ENXIO : ENODEV);
+		retval = ((base_addr || irq) ? -ENXIO : -ENODEV);
+		goto err_out;
 	}
 	mca_set_adapter_name(slot, "3Com 3c523 Etherlink/MC");
 	mca_set_adapter_procfn(slot, (MCA_ProcFn) elmc_getinfo, dev);
@@ -479,15 +489,14 @@
 		break;
 	}
 
-	request_region(dev->base_addr, ELMC_IO_EXTENT, "3c523");
-
-	dev->priv = (void *) kmalloc(sizeof(struct priv), GFP_KERNEL);
+	pr = dev->priv = kmalloc(sizeof(struct priv), GFP_KERNEL);
 	if (dev->priv == NULL) {
-		return -ENOMEM;
+		retval = -ENOMEM;
+		goto err_out;
 	}
-	memset((char *) dev->priv, 0, sizeof(struct priv));
+	memset(pr, 0, sizeof(struct priv));
 
-	((struct priv *) (dev->priv))->slot = slot;
+	pr->slot = slot;
 
 	printk(KERN_INFO "%s: 3Com 3c523 Rev 0x%x at %#lx\n", dev->name, (int) revision,
 	       dev->base_addr);
@@ -513,18 +522,21 @@
 	if (!check586(dev, dev->mem_start, size)) {
 		printk(KERN_ERR "%s: memprobe, Can't find memory at 0x%lx!\n", dev->name,
 		       dev->mem_start);
-		release_region(dev->base_addr, ELMC_IO_EXTENT);
-		return -ENODEV;
+		kfree(dev->priv);
+		dev->priv = NULL;
+		retval = -ENODEV;
+		goto err_out;
 	}
 	dev->mem_end = dev->mem_start + size;	/* set mem_end showed by 'ifconfig' */
 
-	((struct priv *) (dev->priv))->base = dev->mem_start + size - 0x01000000;
+	((struct priv *) (dev->priv))->memtop = bus_to_virt(dev->mem_start) + size;
+	((struct priv *) (dev->priv))->base = (unsigned long) bus_to_virt(dev->mem_start) + size - 0x01000000;
 	alloc586(dev);
 
 	elmc_id_reset586();	/* make sure it doesn't generate spurious ints */
 
 	/* set number of receive-buffs according to memsize */
-	((struct priv *) dev->priv)->num_recv_buffs = NUM_RECV_BUFFS_16;
+	pr->num_recv_buffs = NUM_RECV_BUFFS_16;
 
 	/* dump all the assorted information */
 	printk(KERN_INFO "%s: IRQ %d, %sternal xcvr, memory %#lx-%#lx.\n", dev->name,
@@ -563,6 +575,9 @@
 #endif
 
 	return 0;
+err_out:
+	release_region(dev->base_addr, ELMC_IO_EXTENT);
+	return retval;
 }
 
 /**********************************************
@@ -944,9 +959,11 @@
 				if (skb != NULL) {
 					skb->dev = dev;
 					skb_reserve(skb, 2);	/* 16 byte alignment */
-					memcpy(skb_put(skb, totlen), (u8 *)phys_to_virt(p->base) + (unsigned long) rbd->buffer, totlen);
+					skb_put(skb,totlen);
+					eth_copy_and_sum(skb, (char *) p->base+(unsigned long) rbd->buffer,totlen,0);
 					skb->protocol = eth_type_trans(skb, dev);
 					netif_rx(skb);
+					dev->last_rx = jiffies;
 					p->stats.rx_packets++;
 					p->stats.rx_bytes += totlen;
 				} else {
@@ -1086,6 +1103,7 @@
 static int elmc_send_packet(struct sk_buff *skb, struct net_device *dev)
 {
 	int len;
+	int i;
 #ifndef NO_NOPCOMMANDS
 	int next_nop;
 #endif
diff -urN linux-2.4.2-pre2/drivers/net/3c523.h linux/drivers/net/3c523.h
--- linux-2.4.2-pre2/drivers/net/3c523.h	Thu Dec 12 06:51:09 1996
+++ linux/drivers/net/3c523.h	Mon Dec  3 22:28:20 2001
@@ -9,7 +9,7 @@
  * Intel i82586 Ethernet definitions
  *
  * This is an extension to the Linux operating system, and is covered by the
- * same Gnu Public License that covers that work.
+ * same GNU General Public License that covers that work.
  *
  * Copyright 1995 by Chris Beauregard (cpbeaure@undergrad.math.uwaterloo.ca)
  *
diff -urN linux-2.4.2-pre2/drivers/net/de4x5.c linux/drivers/net/de4x5.c
--- linux-2.4.2-pre2/drivers/net/de4x5.c	Wed Nov  8 17:09:50 2000
+++ linux/drivers/net/de4x5.c	Mon Dec  3 22:28:20 2001
@@ -445,7 +445,7 @@
 #include <linux/ptrace.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/init.h>
@@ -1662,6 +1662,7 @@
 	    STOP_DE4X5;
 	    printk("%s: Fatal bus error occurred, sts=%#8x, device stopped.\n",
 		   dev->name, sts);
+	    spin_unlock(&lp->lock);
 	    return;
 	}
     }
@@ -1733,6 +1734,7 @@
 		    netif_rx(skb);
 		    
 		    /* Update stats */
+		    dev->last_rx = jiffies;
 		    lp->stats.rx_packets++;
  		    lp->stats.rx_bytes += pkt_len;
 		    de4x5_local_stats(dev, skb->data, pkt_len);
diff -urN linux-2.4.2-pre2/drivers/net/de4x5.h linux/drivers/net/de4x5.h
--- linux-2.4.2-pre2/drivers/net/de4x5.h	Mon Dec 11 13:02:04 2000
+++ linux/drivers/net/de4x5.h	Mon Dec  3 22:28:20 2001
@@ -2,7 +2,7 @@
     Copyright 1994 Digital Equipment Corporation.
 
     This software may be used and distributed according to  the terms of the
-    GNU Public License, incorporated herein by reference.
+    GNU General Public License, incorporated herein by reference.
 
     The author may    be  reached as davies@wanton.lkg.dec.com  or   Digital
     Equipment Corporation, 550 King Street, Littleton MA 01460.
diff -urN linux-2.4.2-pre2/drivers/net/ewrk3.c linux/drivers/net/ewrk3.c
--- linux-2.4.2-pre2/drivers/net/ewrk3.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/net/ewrk3.c	Mon Dec  3 22:28:20 2001
@@ -136,8 +136,6 @@
    =========================================================================
  */
 
-static const char *version = "ewrk3.c:v0.43 96/8/16 davies@maniac.ultranet.com\n";
-
 #include <linux/config.h>
 #include <linux/module.h>
 
@@ -147,7 +145,7 @@
 #include <linux/ptrace.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/init.h>
@@ -167,6 +165,9 @@
 
 #include "ewrk3.h"
 
+static const char version[] __initdata =
+"ewrk3.c:v0.43a 2001/02/04 davies@maniac.ultranet.com\n";
+
 #ifdef EWRK3_DEBUG
 static int ewrk3_debug = EWRK3_DEBUG;
 #else
@@ -273,9 +274,9 @@
 	u_char mPage;		/* Maximum 2kB Page number */
 	u_char lemac;		/* Chip rev. level */
 	u_char hard_strapped;	/* Don't allow a full open */
-	u_char lock;		/* Lock the page register */
 	u_char txc;		/* Transmit cut through */
 	u_char *mctbl;		/* Pointer to the multicast table */
+	spinlock_t hw_lock;
 };
 
 /*
@@ -530,6 +531,7 @@
 							lp->shmem_length = shmem_length;
 							lp->lemac = lemac;
 							lp->hard_strapped = hard_strapped;
+							spin_lock_init(&lp->hw_lock);
 
 							lp->mPage = 64;
 							if (cmr & CMR_DRAM)
@@ -715,8 +717,6 @@
 		outb(page, EWRK3_FMQ);	/* to the Free Memory Queue */
 	}
 
-	lp->lock = 0;		/* Ensure there are no locks */
-
 	START_EWRK3;		/* Enable the TX and/or RX */
 }
 
@@ -760,111 +760,118 @@
 /*
    ** Writes a socket buffer to the free page queue
  */
-static int ewrk3_queue_pkt(struct sk_buff *skb, struct net_device *dev)
+static int ewrk3_queue_pkt (struct sk_buff *skb, struct net_device *dev)
 {
 	struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv;
 	u_long iobase = dev->base_addr;
-	int status = 0;
+	u_long buf = 0;
 	u_char icr;
+	u_char page;
 
-	netif_stop_queue(dev);
-#ifdef CONFIG_SMP
-#error "This needs spinlocks"
-#endif
-	DISABLE_IRQs;	/* So that the page # remains correct */
+	spin_lock_irq (&lp->hw_lock);
+	DISABLE_IRQs;
+
+	/* if no resources available, exit, request packet be queued */
+	if (inb (EWRK3_FMQC) == 0) {
+		printk (KERN_WARNING "%s: ewrk3_queue_pkt(): No free resources...\n",
+			dev->name);
+		printk (KERN_WARNING "%s: ewrk3_queue_pkt(): CSR: %02x ICR: %02x FMQC: %02x\n",
+			dev->name, inb (EWRK3_CSR), inb (EWRK3_ICR),
+			inb (EWRK3_FMQC));
+		goto err_out;
+	}
 
 	/*
-	   ** Get a free page from the FMQ when resources are available
+	 ** Get a free page from the FMQ
 	 */
-	if (inb(EWRK3_FMQC) > 0) 
-	{
-		u_long buf = 0;
-		u_char page;
+	if ((page = inb (EWRK3_FMQ)) >= lp->mPage) {
+		printk ("ewrk3_queue_pkt(): Invalid free memory page (%d).\n",
+		     (u_char) page);
+		goto err_out;
+	}
 
-		if ((page = inb(EWRK3_FMQ)) < lp->mPage) {
-			/*
-			   ** Set up shared memory window and pointer into the window
-			 */
-			while (test_and_set_bit(0, (void *) &lp->lock) != 0);	/* Wait for lock to free */
-			if (lp->shmem_length == IO_ONLY) {
-				outb(page, EWRK3_IOPR);
-			} else if (lp->shmem_length == SHMEM_2K) {
-				buf = lp->shmem_base;
-				outb(page, EWRK3_MPR);
-			} else if (lp->shmem_length == SHMEM_32K) {
-				buf = ((((short) page << 11) & 0x7800) + lp->shmem_base);
-				outb((page >> 4), EWRK3_MPR);
-			} else if (lp->shmem_length == SHMEM_64K) {
-				buf = ((((short) page << 11) & 0xf800) + lp->shmem_base);
-				outb((page >> 5), EWRK3_MPR);
-			} else {
-				status = -1;
-				printk(KERN_ERR "%s: Oops - your private data area is hosed!\n", dev->name);
-			}
 
-			if (!status) {
-				/*
-				   ** Set up the buffer control structures and copy the data from
-				   ** the socket buffer to the shared memory .
-				 */
-					if (lp->shmem_length == IO_ONLY) {
-					int i;
-					u_char *p = skb->data;
-						outb((char) (TCR_QMODE | TCR_PAD | TCR_IFC), EWRK3_DATA);
-					outb((char) (skb->len & 0xff), EWRK3_DATA);
-					outb((char) ((skb->len >> 8) & 0xff), EWRK3_DATA);
-					outb((char) 0x04, EWRK3_DATA);
-					for (i = 0; i < skb->len; i++) {
-						outb(*p++, EWRK3_DATA);
-					}
-					outb(page, EWRK3_TQ);	/* Start sending pkt */
-				} else {
-					isa_writeb((char) (TCR_QMODE | TCR_PAD | TCR_IFC), buf);	/* ctrl byte */
-					buf += 1;
-					isa_writeb((char) (skb->len & 0xff), buf);		/* length (16 bit xfer) */
-					buf += 1;
-					if (lp->txc) {
-						isa_writeb((char) (((skb->len >> 8) & 0xff) | XCT), buf);
-						buf += 1;
-						isa_writeb(0x04, buf);	/* index byte */
-						buf += 1;
-						isa_writeb(0x00, (buf + skb->len));	/* Write the XCT flag */
-						isa_memcpy_toio(buf, skb->data, PRELOAD);	/* Write PRELOAD bytes */
-						outb(page, EWRK3_TQ);	/* Start sending pkt */
-						isa_memcpy_toio(buf + PRELOAD, skb->data + PRELOAD, skb->len - PRELOAD);
-						isa_writeb(0xff, (buf + skb->len));	/* Write the XCT flag */
-					} else {
-						isa_writeb((char) ((skb->len >> 8) & 0xff), buf);
-						buf += 1;
-						isa_writeb(0x04, buf);	/* index byte */
-						buf += 1;
-						isa_memcpy_toio(buf, skb->data, skb->len);		/* Write data bytes */
-						outb(page, EWRK3_TQ);	/* Start sending pkt */
-					}
-				}
+	/*
+	 ** Set up shared memory window and pointer into the window
+	 */
+	if (lp->shmem_length == IO_ONLY) {
+		outb (page, EWRK3_IOPR);
+	} else if (lp->shmem_length == SHMEM_2K) {
+		buf = lp->shmem_base;
+		outb (page, EWRK3_MPR);
+	} else if (lp->shmem_length == SHMEM_32K) {
+		buf = ((((short) page << 11) & 0x7800) + lp->shmem_base);
+		outb ((page >> 4), EWRK3_MPR);
+	} else if (lp->shmem_length == SHMEM_64K) {
+		buf = ((((short) page << 11) & 0xf800) + lp->shmem_base);
+		outb ((page >> 5), EWRK3_MPR);
+	} else {
+		printk (KERN_ERR "%s: Oops - your private data area is hosed!\n",
+			dev->name);
+		BUG ();
+	}
 
-				lp->stats.tx_bytes += skb->len;
-				dev->trans_start = jiffies;
-				dev_kfree_skb(skb);
-			} else {	/* return unused page to the free memory queue */
-				outb(page, EWRK3_FMQ);
-			}
-			lp->lock = 0;	/* unlock the page register */
-		} else {
-			printk("ewrk3_queue_pkt(): Invalid free memory page (%d).\n",
-			       (u_char) page);
+	/*
+	 ** Set up the buffer control structures and copy the data from
+	 ** the socket buffer to the shared memory .
+	 */
+	if (lp->shmem_length == IO_ONLY) {
+		int i;
+		u_char *p = skb->data;
+		outb ((char) (TCR_QMODE | TCR_PAD | TCR_IFC), EWRK3_DATA);
+		outb ((char) (skb->len & 0xff), EWRK3_DATA);
+		outb ((char) ((skb->len >> 8) & 0xff), EWRK3_DATA);
+		outb ((char) 0x04, EWRK3_DATA);
+		for (i = 0; i < skb->len; i++) {
+			outb (*p++, EWRK3_DATA);
 		}
+		outb (page, EWRK3_TQ);	/* Start sending pkt */
 	} else {
-		printk(KERN_WARNING "%s: ewrk3_queue_pkt(): No free resources...\n", dev->name);
-		printk(KERN_WARNING "%s: ewrk3_queue_pkt(): CSR: %02x ICR: %02x FMQC: %02x\n", dev->name, inb(EWRK3_CSR), inb(EWRK3_ICR), inb(EWRK3_FMQC));
+		isa_writeb ((char) (TCR_QMODE | TCR_PAD | TCR_IFC), buf);	/* ctrl byte */
+		buf += 1;
+		isa_writeb ((char) (skb->len & 0xff), buf);	/* length (16 bit xfer) */
+		buf += 1;
+		if (lp->txc) {
+			isa_writeb ((char)
+				    (((skb->len >> 8) & 0xff) | XCT), buf);
+			buf += 1;
+			isa_writeb (0x04, buf);	/* index byte */
+			buf += 1;
+			isa_writeb (0x00, (buf + skb->len));	/* Write the XCT flag */
+			isa_memcpy_toio (buf, skb->data, PRELOAD);	/* Write PRELOAD bytes */
+			outb (page, EWRK3_TQ);	/* Start sending pkt */
+			isa_memcpy_toio (buf + PRELOAD,
+					 skb->data + PRELOAD,
+					 skb->len - PRELOAD);
+			isa_writeb (0xff, (buf + skb->len));	/* Write the XCT flag */
+		} else {
+			isa_writeb ((char)
+				    ((skb->len >> 8) & 0xff), buf);
+			buf += 1;
+			isa_writeb (0x04, buf);	/* index byte */
+			buf += 1;
+			isa_memcpy_toio (buf, skb->data, skb->len);	/* Write data bytes */
+			outb (page, EWRK3_TQ);	/* Start sending pkt */
+		}
 	}
 
-	/* Check for free resources: clear 'tbusy' if there are some */
-	if (inb(EWRK3_FMQC) > 0) {
-		netif_wake_queue(dev);
-	}
 	ENABLE_IRQs;
-	return status;
+	spin_unlock_irq (&lp->hw_lock);
+
+	lp->stats.tx_bytes += skb->len;
+	dev->trans_start = jiffies;
+	dev_kfree_skb (skb);
+
+	/* Check for free resources: stop Tx queue if there are none */
+	if (inb (EWRK3_FMQC) == 0)
+		netif_stop_queue (dev);
+
+	return 0;
+
+err_out:
+	ENABLE_IRQs;
+	spin_unlock_irq (&lp->hw_lock);
+	return 1;
 }
 
 /*
@@ -886,6 +893,7 @@
 	/*
 	 ** Mask the EWRK3 board interrupts and turn on the LED
 	 */
+	spin_lock(&lp->hw_lock);
 	DISABLE_IRQs;
 
 	cr = inb(EWRK3_CR);
@@ -917,6 +925,7 @@
 	cr &= ~CR_LED;
 	outb(cr, EWRK3_CR);
 	ENABLE_IRQs;
+	spin_unlock(&lp->hw_lock);
 }
 
 static int ewrk3_rx(struct net_device *dev)
@@ -924,23 +933,12 @@
 	struct ewrk3_private *lp = (struct ewrk3_private *) dev->priv;
 	u_long iobase = dev->base_addr;
 	int i, status = 0;
-	u_char page, tmpPage = 0, tmpLock = 0;
+	u_char page;
 	u_long buf = 0;
 
 	while (inb(EWRK3_RQC) && !status) {	/* Whilst there's incoming data */
 		if ((page = inb(EWRK3_RQ)) < lp->mPage) {	/* Get next entry's buffer page */
 			/*
-			   ** Preempt any process using the current page register. Check for
-			   ** an existing lock to reduce time taken in I/O transactions.
-			 */
-			if ((tmpLock = test_and_set_bit(0, (void *) &lp->lock)) == 1) {		/* Assert lock */
-				if (lp->shmem_length == IO_ONLY) {	/* Get existing page */
-					tmpPage = inb(EWRK3_IOPR);
-				} else {
-					tmpPage = inb(EWRK3_MPR);
-				}
-			}
-			/*
 			   ** Set up shared memory window and pointer into the window
 			 */
 			if (lp->shmem_length == IO_ONLY) {
@@ -1045,15 +1043,6 @@
 			   ** Return the received buffer to the free memory queue
 			 */
 			outb(page, EWRK3_FMQ);
-
-			if (tmpLock) {	/* If a lock was preempted */
-				if (lp->shmem_length == IO_ONLY) {	/* Replace old page */
-					outb(tmpPage, EWRK3_IOPR);
-				} else {
-					outb(tmpPage, EWRK3_MPR);
-				}
-			}
-			lp->lock = 0;	/* Unlock the page register */
 		} else {
 			printk("ewrk3_rx(): Illegal page number, page %d\n", page);
 			printk("ewrk3_rx(): CSR: %02x ICR: %02x FMQC: %02x\n", inb(EWRK3_CSR), inb(EWRK3_ICR), inb(EWRK3_FMQC));
@@ -1191,7 +1180,7 @@
 	u16 hashcode;
 	s32 crc, poly = CRC_POLYNOMIAL_LE;
 
-	while (test_and_set_bit(0, (void *) &lp->lock) != 0);	/* Wait for lock to free */
+	spin_lock_irq(&lp->hw_lock);
 
 	if (lp->shmem_length == IO_ONLY) {
 		outb(0, EWRK3_IOPR);
@@ -1258,9 +1247,7 @@
 		}
 	}
 
-	lp->lock = 0;		/* Unlock the page register */
-
-	return;
+	spin_unlock_irq(&lp->hw_lock);
 }
 
 /*
@@ -1710,24 +1697,22 @@
 
 		break;
 	case EWRK3_GET_MCA:	/* Get the multicast address table */
-			while (test_and_set_bit(0, (void *) &lp->lock) != 0);	/* Wait for lock to free */
-			if (lp->shmem_length == IO_ONLY) {
-				outb(0, EWRK3_IOPR);
-				outw(PAGE0_HTE, EWRK3_PIR1);
-				for (i = 0; i < (HASH_TABLE_LEN >> 3); i++) {
-					tmp.addr[i] = inb(EWRK3_DATA);
-				}
-			} else {
-				outb(0, EWRK3_MPR);
-				isa_memcpy_fromio(tmp.addr, lp->shmem_base + PAGE0_HTE, (HASH_TABLE_LEN >> 3));
-			}
-			ioc->len = (HASH_TABLE_LEN >> 3);
-			if (copy_to_user(ioc->data, tmp.addr, ioc->len)) {
-				status = -EFAULT;
-				break;
+		spin_lock_irq(&lp->hw_lock);
+		if (lp->shmem_length == IO_ONLY) {
+			outb(0, EWRK3_IOPR);
+			outw(PAGE0_HTE, EWRK3_PIR1);
+			for (i = 0; i < (HASH_TABLE_LEN >> 3); i++) {
+				tmp.addr[i] = inb(EWRK3_DATA);
 			}
+		} else {
+			outb(0, EWRK3_MPR);
+			isa_memcpy_fromio(tmp.addr, lp->shmem_base + PAGE0_HTE, (HASH_TABLE_LEN >> 3));
+		}
+		spin_unlock_irq(&lp->hw_lock);
 
-		lp->lock = 0;	/* Unlock the page register */
+		ioc->len = (HASH_TABLE_LEN >> 3);
+		if (copy_to_user(ioc->data, tmp.addr, ioc->len))
+			status = -EFAULT;
 
 		break;
 	case EWRK3_SET_MCA:	/* Set a multicast address */
diff -urN linux-2.4.2-pre2/drivers/net/ne2.c linux/drivers/net/ne2.c
--- linux-2.4.2-pre2/drivers/net/ne2.c	Tue Dec  5 12:29:38 2000
+++ linux/drivers/net/ne2.c	Mon Dec  3 22:28:20 2001
@@ -4,7 +4,7 @@
    modified by Wim Dumon (Apr 1996)
 
    This software may be used and distributed according to the terms
-   of the GNU Public License, incorporated herein by reference.
+   of the GNU General Public License, incorporated herein by reference.
 
    The author may be reached as wimpie@linux.cc.kuleuven.ac.be
 
@@ -45,6 +45,9 @@
 
    Mon Nov 16 15:28:23 CET 1998 (Wim Dumon)
    - pass 'dev' as last parameter of request_irq in stead of 'NULL'   
+
+   Wed Feb  7 21:24:00 CET 2001 (Alfred Arnold)
+   - added support for the D-Link DE-320CT
    
    *    WARNING
 	-------
@@ -67,7 +70,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <asm/system.h>
 #include <asm/bitops.h>
@@ -114,6 +117,11 @@
 		{0x1000, 0x2020, 0x8020, 0xa0a0, 0xb0b0, 0xc0c0, 0xc3d0};
 static int irqs[4] __initdata = {3, 4, 5, 9};
 
+/* From the D-Link ADF file: */
+static unsigned int dlink_addresses[4]=
+                {0x300, 0x320, 0x340, 0x360};
+static int dlink_irqs[8] = {3, 4, 5, 9, 10, 11, 14, 15};
+
 struct ne2_adapters_t {
 	unsigned int	id;
 	char		*name;
@@ -123,6 +131,7 @@
 	{ 0x6354, "Arco Ethernet Adapter AE/2" },
 	{ 0x70DE, "Compex ENET-16 MC/P" },
 	{ 0x7154, "Novell Ethernet Adapter NE/2" },
+        { 0x56ea, "D-Link DE-320CT" },
 	{ 0x0000, NULL }
 };
 
@@ -143,6 +152,98 @@
 
 
 /*
+ * special code to read the DE-320's MAC address EEPROM.  In contrast to a 
+ * standard NE design, this is a serial EEPROM (93C46) that has to be read
+ * bit by bit.  The EEPROM cotrol port at base + 0x1e has the following 
+ * layout:
+ *
+ * Bit 0 = Data out (read from EEPROM)
+ * Bit 1 = Data in  (write to EEPROM)
+ * Bit 2 = Clock
+ * Bit 3 = Chip Select
+ * Bit 7 = ~50 kHz clock for defined delays
+ *
+ */
+
+static void dlink_put_eeprom(unsigned char value, unsigned int addr)
+{
+	int z;
+	unsigned char v1, v2;
+
+	/* write the value to the NIC EEPROM register */
+
+	outb(value, addr + 0x1e);
+
+	/* now wait the clock line to toggle twice.  Effectively, we are
+	   waiting (at least) for one clock cycle */
+
+	for (z = 0; z < 2; z++) {
+		do {
+			v1 = inb(addr + 0x1e);
+			v2 = inb(addr + 0x1e);
+		}
+		while (!((v1 ^ v2) & 0x80));
+	}
+}
+
+static void dlink_send_eeprom_bit(unsigned int bit, unsigned int addr)
+{
+	/* shift data bit into correct position */
+
+	bit = bit << 1;
+
+	/* write value, keep clock line high for two cycles */
+
+	dlink_put_eeprom(0x09 | bit, addr);
+	dlink_put_eeprom(0x0d | bit, addr);
+	dlink_put_eeprom(0x0d | bit, addr);
+	dlink_put_eeprom(0x09 | bit, addr);
+}
+
+static void dlink_send_eeprom_word(unsigned int value, unsigned int len, unsigned int addr)
+{
+	int z;
+
+	/* adjust bits so that they are left-aligned in a 16-bit-word */
+
+	value = value << (16 - len);
+
+	/* shift bits out to the EEPROM */
+
+	for (z = 0; z < len; z++) {
+		dlink_send_eeprom_bit((value & 0x8000) >> 15, addr);
+		value = value << 1;
+	}
+}
+
+static unsigned int dlink_get_eeprom(unsigned int eeaddr, unsigned int addr)
+{
+	int z;
+	unsigned int value = 0;
+ 
+	/* pull the CS line low for a moment.  This resets the EEPROM-
+	   internal logic, and makes it ready for a new command. */
+
+	dlink_put_eeprom(0x01, addr);
+	dlink_put_eeprom(0x09, addr);
+
+	/* send one start bit, read command (1 - 0), plus the address to
+           the EEPROM */
+
+	dlink_send_eeprom_word(0x0180 | (eeaddr & 0x3f), 9, addr);
+
+	/* get the data word.  We clock by sending 0s to the EEPROM, which
+	   get ignored during the read process */
+
+	for (z = 0; z < 16; z++) {
+		dlink_send_eeprom_bit(0, addr);
+		value = (value << 1) | (inb(addr + 0x1e) & 0x01);
+	}
+
+	return value;
+}
+
+/*
  * Note that at boot, this probe only picks up one card at a time.
  */
 
@@ -221,12 +322,20 @@
 		return -ENODEV;
 	}
 
-	i = (POS & 0xE)>>1;
-	/* printk("Halleluja sdog, als er na de pijl een 1 staat is 1 - 1 == 0"
-	   " en zou het moeten werken -> %d\n", i);
-	   The above line was for remote testing, thanx to sdog ... */
-	base_addr = addresses[i - 1];
-	irq = irqs[(POS & 0x60)>>5];
+	/* handle different POS register structure for D-Link card */
+
+	if (mca_read_stored_pos(slot, 0) == 0xea) {
+		base_addr = dlink_addresses[(POS >> 5) & 0x03];
+		irq = dlink_irqs[(POS >> 2) & 0x07];
+	}
+        else {
+		i = (POS & 0xE)>>1;
+		/* printk("Halleluja sdog, als er na de pijl een 1 staat is 1 - 1 == 0"
+	   	" en zou het moeten werken -> %d\n", i);
+	   	The above line was for remote testing, thanx to sdog ... */
+		base_addr = addresses[i - 1];
+		irq = irqs[(POS & 0x60)>>5];
+	}
 
 	if (!request_region(base_addr, NE_IO_EXTENT, dev->name))
 		return -EBUSY;
@@ -307,6 +416,20 @@
 	}
 	for(i = 0; i < 6 /*sizeof(SA_prom)*/; i+=1) {
 		SA_prom[i] = inb(base_addr + NE_DATAPORT);
+	}
+
+	/* I don't know whether the previous sequence includes the general
+           board reset procedure, so better don't omit it and just overwrite
+           the garbage read from a DE-320 with correct stuff. */
+
+	if (mca_read_stored_pos(slot, 0) == 0xea) {
+		unsigned int v;
+
+		for (i = 0; i < 3; i++) {
+ 			v = dlink_get_eeprom(i, base_addr);
+			SA_prom[(i << 1)    ] = v & 0xff;
+			SA_prom[(i << 1) + 1] = (v >> 8) & 0xff;
+		}
 	}
 
 	start_page = NESM_START_PG;
diff -urN linux-2.4.2-pre2/drivers/parport/init.c linux/drivers/parport/init.c
--- linux-2.4.2-pre2/drivers/parport/init.c	Wed Jul 12 16:24:33 2000
+++ linux/drivers/parport/init.c	Mon Dec  3 22:28:20 2001
@@ -15,7 +15,7 @@
 #include <linux/parport.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 
 #ifndef MODULE
diff -urN linux-2.4.2-pre2/drivers/parport/parport_arc.c linux/drivers/parport/parport_arc.c
--- linux-2.4.2-pre2/drivers/parport/parport_arc.c	Thu Aug  5 14:23:14 1999
+++ linux/drivers/parport/parport_arc.c	Mon Dec  3 22:28:20 2001
@@ -20,7 +20,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/parport.h>
 
 #include <asm/ptrace.h>
diff -urN linux-2.4.2-pre2/drivers/parport/parport_gsc.c linux/drivers/parport/parport_gsc.c
--- linux-2.4.2-pre2/drivers/parport/parport_gsc.c	Fri Dec 29 14:07:22 2000
+++ linux/drivers/parport/parport_gsc.c	Mon Dec  3 22:28:20 2001
@@ -27,7 +27,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/sysctl.h>
 
diff -urN linux-2.4.2-pre2/drivers/parport/parport_pc.c linux/drivers/parport/parport_pc.c
--- linux-2.4.2-pre2/drivers/parport/parport_pc.c	Thu Jan  4 13:12:48 2001
+++ linux/drivers/parport/parport_pc.c	Mon Dec  3 22:28:20 2001
@@ -48,7 +48,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/sysctl.h>
 
diff -urN linux-2.4.2-pre2/drivers/parport/parport_sunbpp.c linux/drivers/parport/parport_sunbpp.c
--- linux-2.4.2-pre2/drivers/parport/parport_sunbpp.c	Thu Mar 30 16:54:53 2000
+++ linux/drivers/parport/parport_sunbpp.c	Mon Dec  3 22:28:20 2001
@@ -22,7 +22,7 @@
 #include <linux/errno.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 
 #include <linux/parport.h>
diff -urN linux-2.4.2-pre2/drivers/parport/procfs.c linux/drivers/parport/procfs.c
--- linux-2.4.2-pre2/drivers/parport/procfs.c	Wed Jul  5 11:55:45 2000
+++ linux/drivers/parport/procfs.c	Mon Dec  3 22:28:20 2001
@@ -16,7 +16,7 @@
 #include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/parport.h>
 #include <linux/ctype.h>
 #include <linux/sysctl.h>
diff -urN linux-2.4.2-pre2/drivers/parport/share.c linux/drivers/parport/share.c
--- linux-2.4.2-pre2/drivers/parport/share.c	Mon Jul 24 18:59:27 2000
+++ linux/drivers/parport/share.c	Mon Dec  3 22:28:20 2001
@@ -26,7 +26,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/kmod.h>
 
diff -urN linux-2.4.2-pre2/drivers/pci/pci.c linux/drivers/pci/pci.c
--- linux-2.4.2-pre2/drivers/pci/pci.c	Mon Dec 11 13:46:26 2000
+++ linux/drivers/pci/pci.c	Mon Dec  3 22:28:20 2001
@@ -16,7 +16,7 @@
 #include <linux/pci.h>
 #include <linux/string.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/spinlock.h>
 #include <linux/pm.h>
diff -urN linux-2.4.2-pre2/drivers/pcmcia/bulkmem.c linux/drivers/pcmcia/bulkmem.c
--- linux-2.4.2-pre2/drivers/pcmcia/bulkmem.c	Thu Oct 26 16:52:16 2000
+++ linux/drivers/pcmcia/bulkmem.c	Mon Dec  3 22:28:20 2001
@@ -37,7 +37,7 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/timer.h>
diff -urN linux-2.4.2-pre2/drivers/pcmcia/cardbus.c linux/drivers/pcmcia/cardbus.c
--- linux-2.4.2-pre2/drivers/pcmcia/cardbus.c	Wed Nov  8 17:03:09 2000
+++ linux/drivers/pcmcia/cardbus.c	Mon Dec  3 22:28:20 2001
@@ -51,7 +51,7 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/pci.h>
 #include <linux/ioport.h>
diff -urN linux-2.4.2-pre2/drivers/pcmcia/cb_enabler.c linux/drivers/pcmcia/cb_enabler.c
--- linux-2.4.2-pre2/drivers/pcmcia/cb_enabler.c	Sat Sep  2 00:13:49 2000
+++ linux/drivers/pcmcia/cb_enabler.c	Mon Dec  3 22:28:20 2001
@@ -43,7 +43,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 
diff -urN linux-2.4.2-pre2/drivers/pcmcia/cistpl.c linux/drivers/pcmcia/cistpl.c
--- linux-2.4.2-pre2/drivers/pcmcia/cistpl.c	Thu Oct 26 16:52:16 2000
+++ linux/drivers/pcmcia/cistpl.c	Mon Dec  3 22:28:20 2001
@@ -40,7 +40,7 @@
 #include <linux/major.h>
 #include <linux/errno.h>
 #include <linux/timer.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/pci.h>
diff -urN linux-2.4.2-pre2/drivers/pcmcia/cs.c linux/drivers/pcmcia/cs.c
--- linux-2.4.2-pre2/drivers/pcmcia/cs.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/pcmcia/cs.c	Mon Dec  3 22:28:20 2001
@@ -38,7 +38,7 @@
 #include <linux/string.h>
 #include <linux/major.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/timer.h>
diff -urN linux-2.4.2-pre2/drivers/pcmcia/ds.c linux/drivers/pcmcia/ds.c
--- linux-2.4.2-pre2/drivers/pcmcia/ds.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/pcmcia/ds.c	Mon Dec  3 22:28:20 2001
@@ -38,7 +38,7 @@
 #include <linux/major.h>
 #include <linux/string.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/fcntl.h>
 #include <linux/sched.h>
diff -urN linux-2.4.2-pre2/drivers/pcmcia/i82365.c linux/drivers/pcmcia/i82365.c
--- linux-2.4.2-pre2/drivers/pcmcia/i82365.c	Thu Nov 16 16:38:16 2000
+++ linux/drivers/pcmcia/i82365.c	Mon Dec  3 22:28:20 2001
@@ -41,7 +41,7 @@
 #include <linux/errno.h>
 #include <linux/timer.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
diff -urN linux-2.4.2-pre2/drivers/pcmcia/rsrc_mgr.c linux/drivers/pcmcia/rsrc_mgr.c
--- linux-2.4.2-pre2/drivers/pcmcia/rsrc_mgr.c	Sat Sep  2 00:13:49 2000
+++ linux/drivers/pcmcia/rsrc_mgr.c	Mon Dec  3 22:28:20 2001
@@ -40,7 +40,7 @@
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/types.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/timer.h>
 #include <asm/irq.h>
diff -urN linux-2.4.2-pre2/drivers/pcmcia/tcic.c linux/drivers/pcmcia/tcic.c
--- linux-2.4.2-pre2/drivers/pcmcia/tcic.c	Thu Nov 16 16:38:16 2000
+++ linux/drivers/pcmcia/tcic.c	Mon Dec  3 22:28:20 2001
@@ -45,7 +45,7 @@
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/timer.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
diff -urN linux-2.4.2-pre2/drivers/pnp/isapnp.c linux/drivers/pnp/isapnp.c
--- linux-2.4.2-pre2/drivers/pnp/isapnp.c	Mon Dec 11 12:38:58 2000
+++ linux/drivers/pnp/isapnp.c	Mon Dec  3 22:28:20 2001
@@ -31,7 +31,7 @@
 #include <linux/errno.h>
 #include <linux/ioport.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <asm/io.h>
 #include <asm/dma.h>
diff -urN linux-2.4.2-pre2/drivers/s390/block/dasd.c linux/drivers/s390/block/dasd.c
--- linux-2.4.2-pre2/drivers/s390/block/dasd.c	Mon Jan 15 13:08:15 2001
+++ linux/drivers/s390/block/dasd.c	Mon Dec  3 22:28:20 2001
@@ -17,7 +17,7 @@
 
 #include <linux/tqueue.h>
 #include <linux/timer.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/genhd.h>
 #include <linux/devfs_fs_kernel.h>
 #include <linux/hdreg.h>
diff -urN linux-2.4.2-pre2/drivers/s390/block/dasd_ccwstuff.c linux/drivers/s390/block/dasd_ccwstuff.c
--- linux-2.4.2-pre2/drivers/s390/block/dasd_ccwstuff.c	Fri May 12 11:41:44 2000
+++ linux/drivers/s390/block/dasd_ccwstuff.c	Mon Dec  3 22:28:20 2001
@@ -7,7 +7,7 @@
 
 #include <linux/stddef.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/dasd.h>
 #include <asm/atomic.h>
 
diff -urN linux-2.4.2-pre2/drivers/s390/block/dasd_eckd.c linux/drivers/s390/block/dasd_eckd.c
--- linux-2.4.2-pre2/drivers/s390/block/dasd_eckd.c	Fri May 12 11:41:44 2000
+++ linux/drivers/s390/block/dasd_eckd.c	Mon Dec  3 22:28:20 2001
@@ -12,7 +12,7 @@
 #include <linux/module.h>
 #endif				/* MODULE */
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/dasd.h>
 #include <asm/io.h>
 
diff -urN linux-2.4.2-pre2/drivers/s390/block/mdisk.c linux/drivers/s390/block/mdisk.c
--- linux-2.4.2-pre2/drivers/s390/block/mdisk.c	Thu Oct 26 23:35:48 2000
+++ linux/drivers/s390/block/mdisk.c	Mon Dec  3 22:28:20 2001
@@ -21,7 +21,7 @@
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>              /* printk()                         */
-#include <linux/malloc.h>              /* kmalloc()                        */
+#include <linux/slab.h>              /* kmalloc()                        */
 #include <linux/vmalloc.h>             /* vmalloc()                        */
 #include <linux/fs.h>                  /* everything...                    */
 #include <linux/errno.h>               /* error codes                      */
diff -urN linux-2.4.2-pre2/drivers/s390/char/con3215.c linux/drivers/s390/char/con3215.c
--- linux-2.4.2-pre2/drivers/s390/char/con3215.c	Wed Nov 15 00:41:03 2000
+++ linux/drivers/s390/char/con3215.c	Mon Dec  3 22:28:20 2001
@@ -16,7 +16,7 @@
 #include <linux/console.h>
 #include <linux/interrupt.h>
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/bootmem.h>
 #include <asm/io.h>
 #include <asm/ebcdic.h>
diff -urN linux-2.4.2-pre2/drivers/s390/net/ctc.c linux/drivers/s390/net/ctc.c
--- linux-2.4.2-pre2/drivers/s390/net/ctc.c	Mon Dec 11 12:39:45 2000
+++ linux/drivers/s390/net/ctc.c	Mon Dec  3 22:28:20 2001
@@ -46,7 +46,7 @@
 #include <linux/version.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/s390/net/iucv.c linux/drivers/s390/net/iucv.c
--- linux-2.4.2-pre2/drivers/s390/net/iucv.c	Fri May 12 11:41:44 2000
+++ linux/drivers/s390/net/iucv.c	Mon Dec  3 22:28:20 2001
@@ -20,7 +20,7 @@
 #include <linux/version.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>              /* printk()                         */
-#include <linux/malloc.h>              /* kmalloc()                        */
+#include <linux/slab.h>              /* kmalloc()                        */
 #include <linux/errno.h>               /* error codes                      */
 #include <linux/types.h>               /* size_t                           */
 #include <linux/interrupt.h>           /* mark_bh                          */
diff -urN linux-2.4.2-pre2/drivers/sbus/audio/amd7930.c linux/drivers/sbus/audio/amd7930.c
--- linux-2.4.2-pre2/drivers/sbus/audio/amd7930.c	Mon Jan 22 13:30:20 2001
+++ linux/drivers/sbus/audio/amd7930.c	Mon Dec  3 22:28:20 2001
@@ -88,7 +88,7 @@
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/version.h>
 #include <linux/soundcard.h>
diff -urN linux-2.4.2-pre2/drivers/sbus/audio/audio.c linux/drivers/sbus/audio/audio.c
--- linux-2.4.2-pre2/drivers/sbus/audio/audio.c	Mon Oct 23 15:48:27 2000
+++ linux/drivers/sbus/audio/audio.c	Mon Dec  3 22:28:20 2001
@@ -1,4 +1,4 @@
-/* $Id: audio.c,v 1.56 2000/10/19 00:50:02 davem Exp $
+/* $Id: audio.c,v 1.57 2001/02/02 08:36:55 davem Exp $
  * drivers/sbus/audio/audio.c
  *
  * Copyright 1996 Thomas K. Dyas (tdyas@noc.rutgers.edu)
@@ -28,13 +28,13 @@
 #include <linux/mm.h>
 #include <linux/tqueue.h>
 #include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/soundcard.h>
 #include <linux/version.h>
 #include <linux/devfs_fs_kernel.h>
-#include <asm/delay.h>
+#include <linux/delay.h>
 #include <asm/pgtable.h>
 
 #include <asm/audioio.h>
@@ -511,7 +511,7 @@
                         m = drv->ops->get_input_balance(drv);
                 i = OSS_TO_GAIN(k);
                 j = OSS_TO_BAL(k);
-                oprintk((" for stereo to to %d (bal %d):", i, j));
+                oprintk((" for stereo to do %d (bal %d):", i, j));
                 if (drv->ops->set_input_volume)
                         drv->ops->set_input_volume(drv, i);
                 if (drv->ops->set_input_balance)
diff -urN linux-2.4.2-pre2/drivers/sbus/audio/cs4231.c linux/drivers/sbus/audio/cs4231.c
--- linux-2.4.2-pre2/drivers/sbus/audio/cs4231.c	Fri Feb 18 15:07:20 2000
+++ linux/drivers/sbus/audio/cs4231.c	Mon Dec  3 22:28:20 2001
@@ -22,7 +22,7 @@
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/soundcard.h>
diff -urN linux-2.4.2-pre2/drivers/sbus/audio/dbri.c linux/drivers/sbus/audio/dbri.c
--- linux-2.4.2-pre2/drivers/sbus/audio/dbri.c	Mon Jan 22 13:30:20 2001
+++ linux/drivers/sbus/audio/dbri.c	Mon Dec  3 22:28:20 2001
@@ -1,4 +1,4 @@
-/* $Id: dbri.c,v 1.23 2001/01/08 04:19:16 davem Exp $
+/* $Id: dbri.c,v 1.24 2001/02/02 08:36:55 davem Exp $
  * drivers/sbus/audio/dbri.c
  *
  * Copyright (C) 1997 Rudolf Koenig (rfkoenig@immd4.informatik.uni-erlangen.de)
@@ -47,14 +47,14 @@
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/version.h>
+#include <linux/delay.h>
 #include <asm/openprom.h>
 #include <asm/oplib.h>
 #include <asm/system.h>
 #include <asm/irq.h>
 #include <asm/io.h>
-#include <asm/delay.h>
 #include <asm/sbus.h>
 #include <asm/pgtable.h>
 
diff -urN linux-2.4.2-pre2/drivers/sbus/audio/dmy.c linux/drivers/sbus/audio/dmy.c
--- linux-2.4.2-pre2/drivers/sbus/audio/dmy.c	Fri Dec 29 14:07:22 2000
+++ linux/drivers/sbus/audio/dmy.c	Mon Dec  3 22:28:20 2001
@@ -13,7 +13,7 @@
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/soundcard.h>
 #include <linux/delay.h>
diff -urN linux-2.4.2-pre2/drivers/sbus/char/envctrl.c linux/drivers/sbus/char/envctrl.c
--- linux-2.4.2-pre2/drivers/sbus/char/envctrl.c	Thu Nov  9 15:57:41 2000
+++ linux/drivers/sbus/char/envctrl.c	Mon Dec  3 22:28:20 2001
@@ -25,7 +25,7 @@
 #include <linux/init.h>
 #include <linux/miscdevice.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <asm/ebus.h>
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/drivers/sbus/char/flash.c linux/drivers/sbus/char/flash.c
--- linux-2.4.2-pre2/drivers/sbus/char/flash.c	Mon Jan 22 13:30:20 2001
+++ linux/drivers/sbus/char/flash.c	Mon Dec  3 22:28:20 2001
@@ -9,7 +9,7 @@
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
 #include <linux/poll.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/sbus/char/jsflash.c linux/drivers/sbus/char/jsflash.c
--- linux-2.4.2-pre2/drivers/sbus/char/jsflash.c	Mon Jan 22 13:30:20 2001
+++ linux/drivers/sbus/char/jsflash.c	Mon Dec  3 22:28:20 2001
@@ -30,7 +30,7 @@
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
 #include <linux/poll.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/sbus/char/openprom.c linux/drivers/sbus/char/openprom.c
--- linux-2.4.2-pre2/drivers/sbus/char/openprom.c	Thu Nov  9 15:57:41 2000
+++ linux/drivers/sbus/char/openprom.c	Mon Dec  3 22:28:20 2001
@@ -36,7 +36,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/miscdevice.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/sbus/char/pcikbd.c linux/drivers/sbus/char/pcikbd.c
--- linux-2.4.2-pre2/drivers/sbus/char/pcikbd.c	Mon Jan 22 13:30:20 2001
+++ linux/drivers/sbus/char/pcikbd.c	Mon Dec  3 22:28:20 2001
@@ -16,7 +16,7 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/poll.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/random.h>
 #include <linux/miscdevice.h>
diff -urN linux-2.4.2-pre2/drivers/sbus/char/rtc.c linux/drivers/sbus/char/rtc.c
--- linux-2.4.2-pre2/drivers/sbus/char/rtc.c	Mon Jan 22 13:30:20 2001
+++ linux/drivers/sbus/char/rtc.c	Mon Dec  3 22:28:20 2001
@@ -15,7 +15,7 @@
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
 #include <linux/poll.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/sbus/char/sab82532.c linux/drivers/sbus/char/sab82532.c
--- linux-2.4.2-pre2/drivers/sbus/char/sab82532.c	Mon Dec 11 12:37:03 2000
+++ linux/drivers/sbus/char/sab82532.c	Mon Dec  3 22:28:20 2001
@@ -24,7 +24,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 
diff -urN linux-2.4.2-pre2/drivers/sbus/char/su.c linux/drivers/sbus/char/su.c
--- linux-2.4.2-pre2/drivers/sbus/char/su.c	Tue Nov 14 23:36:01 2000
+++ linux/drivers/sbus/char/su.c	Mon Dec  3 22:28:20 2001
@@ -61,7 +61,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/bootmem.h>
 #include <linux/delay.h>
diff -urN linux-2.4.2-pre2/drivers/sbus/char/uctrl.c linux/drivers/sbus/char/uctrl.c
--- linux-2.4.2-pre2/drivers/sbus/char/uctrl.c	Thu Nov  9 15:57:41 2000
+++ linux/drivers/sbus/char/uctrl.c	Mon Dec  3 22:28:20 2001
@@ -9,7 +9,7 @@
 #include <linux/errno.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
 #include <linux/miscdevice.h>
diff -urN linux-2.4.2-pre2/drivers/sbus/char/vfc_dev.c linux/drivers/sbus/char/vfc_dev.c
--- linux-2.4.2-pre2/drivers/sbus/char/vfc_dev.c	Mon Jan 22 13:30:20 2001
+++ linux/drivers/sbus/char/vfc_dev.c	Mon Dec  3 22:28:20 2001
@@ -17,11 +17,12 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
 #include <linux/smp_lock.h>
+#include <linux/delay.h>
 #include <linux/spinlock.h>
 
 #include <asm/openprom.h>
@@ -29,7 +30,6 @@
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/sbus.h>
-#include <asm/delay.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/drivers/sbus/char/vfc_i2c.c linux/drivers/sbus/char/vfc_i2c.c
--- linux-2.4.2-pre2/drivers/sbus/char/vfc_i2c.c	Fri May  5 12:37:52 2000
+++ linux/drivers/sbus/char/vfc_i2c.c	Mon Dec  3 22:28:20 2001
@@ -20,7 +20,7 @@
 
 #include <linux/kernel.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/wait.h>
diff -urN linux-2.4.2-pre2/drivers/sbus/dvma.c linux/drivers/sbus/dvma.c
--- linux-2.4.2-pre2/drivers/sbus/dvma.c	Thu Feb 17 09:26:31 2000
+++ linux/drivers/sbus/dvma.c	Mon Dec  3 22:28:20 2001
@@ -6,11 +6,11 @@
 #include <linux/config.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
+#include <linux/delay.h>
 
 #include <asm/oplib.h>
-#include <asm/delay.h>
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <asm/sbus.h>
diff -urN linux-2.4.2-pre2/drivers/sbus/sbus.c linux/drivers/sbus/sbus.c
--- linux-2.4.2-pre2/drivers/sbus/sbus.c	Mon Jan 29 08:08:46 2001
+++ linux/drivers/sbus/sbus.c	Mon Dec  3 22:28:20 2001
@@ -5,7 +5,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pci.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/53c7,8xx.c linux/drivers/scsi/53c7,8xx.c
--- linux-2.4.2-pre2/drivers/scsi/53c7,8xx.c	Mon Sep 18 13:36:24 2000
+++ linux/drivers/scsi/53c7,8xx.c	Mon Dec  3 22:28:20 2001
@@ -229,7 +229,7 @@
 #include <linux/pci.h>
 #include <linux/proc_fs.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/mm.h>
 #include <linux/ioport.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/53c7xx.c linux/drivers/scsi/53c7xx.c
--- linux-2.4.2-pre2/drivers/scsi/53c7xx.c	Sat Nov 11 19:01:11 2000
+++ linux/drivers/scsi/53c7xx.c	Mon Dec  3 22:28:20 2001
@@ -246,7 +246,7 @@
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/mm.h>
 #include <linux/ioport.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/NCR53C9x.c linux/drivers/scsi/NCR53C9x.c
--- linux-2.4.2-pre2/drivers/scsi/NCR53C9x.c	Mon Jun 19 17:59:41 2000
+++ linux/drivers/scsi/NCR53C9x.c	Mon Dec  3 22:28:20 2001
@@ -30,7 +30,7 @@
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/advansys.c linux/drivers/scsi/advansys.c
--- linux-2.4.2-pre2/drivers/scsi/advansys.c	Sat Nov 11 19:01:11 2000
+++ linux/drivers/scsi/advansys.c	Mon Dec  3 22:28:21 2001
@@ -763,7 +763,7 @@
 #include <linux/types.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #if LINUX_VERSION_CODE >= ASC_LINUX_VERSION(1,3,0)
 #include <linux/proc_fs.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/aic7xxx.c linux/drivers/scsi/aic7xxx.c
--- linux-2.4.2-pre2/drivers/scsi/aic7xxx.c	Thu Oct 12 14:19:32 2000
+++ linux/drivers/scsi/aic7xxx.c	Mon Dec  3 22:28:21 2001
@@ -256,7 +256,7 @@
 #include <scsi/scsicam.h>
 
 #include <linux/stat.h>
-#include <linux/malloc.h>        /* for kmalloc() */
+#include <linux/slab.h>        /* for kmalloc() */
 
 #include <linux/config.h>        /* for CONFIG_PCI */
 
diff -urN linux-2.4.2-pre2/drivers/scsi/blz1230.c linux/drivers/scsi/blz1230.c
--- linux-2.4.2-pre2/drivers/scsi/blz1230.c	Mon Oct 16 12:51:16 2000
+++ linux/drivers/scsi/blz1230.c	Mon Dec  3 22:28:21 2001
@@ -21,7 +21,7 @@
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/blz2060.c linux/drivers/scsi/blz2060.c
--- linux-2.4.2-pre2/drivers/scsi/blz2060.c	Mon Oct 16 12:51:16 2000
+++ linux/drivers/scsi/blz2060.c	Mon Dec  3 22:28:21 2001
@@ -21,7 +21,7 @@
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/cpqfcTScontrol.c linux/drivers/scsi/cpqfcTScontrol.c
--- linux-2.4.2-pre2/drivers/scsi/cpqfcTScontrol.c	Tue Sep 19 08:01:34 2000
+++ linux/drivers/scsi/cpqfcTScontrol.c	Mon Dec  3 22:28:21 2001
@@ -35,7 +35,7 @@
 #include <linux/string.h>
 #include <linux/ioport.h>  // request_region() prototype
 #include <linux/sched.h>
-#include <linux/malloc.h>  // need "kfree" for ext. S/G pages
+#include <linux/slab.h>  // need "kfree" for ext. S/G pages
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/delay.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/cpqfcTSinit.c linux/drivers/scsi/cpqfcTSinit.c
--- linux-2.4.2-pre2/drivers/scsi/cpqfcTSinit.c	Sat Nov 11 19:01:11 2000
+++ linux/drivers/scsi/cpqfcTSinit.c	Mon Dec  3 22:28:21 2001
@@ -1686,7 +1686,7 @@
 
 
 
-#include "linux/malloc.h"
+#include "linux/slab.h"
 
 // Dynamic memory allocation alignment routines
 // HP's Tachyon Fibre Channel Controller chips require
diff -urN linux-2.4.2-pre2/drivers/scsi/cpqfcTSworker.c linux/drivers/scsi/cpqfcTSworker.c
--- linux-2.4.2-pre2/drivers/scsi/cpqfcTSworker.c	Tue Sep 19 08:01:35 2000
+++ linux/drivers/scsi/cpqfcTSworker.c	Mon Dec  3 22:28:21 2001
@@ -22,7 +22,7 @@
 #include <linux/sched.h>
 #include <linux/timer.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/cyberstorm.c linux/drivers/scsi/cyberstorm.c
--- linux-2.4.2-pre2/drivers/scsi/cyberstorm.c	Mon Oct 16 12:51:16 2000
+++ linux/drivers/scsi/cyberstorm.c	Mon Dec  3 22:28:21 2001
@@ -24,7 +24,7 @@
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/cyberstormII.c linux/drivers/scsi/cyberstormII.c
--- linux-2.4.2-pre2/drivers/scsi/cyberstormII.c	Mon Oct 16 12:51:16 2000
+++ linux/drivers/scsi/cyberstormII.c	Mon Dec  3 22:28:21 2001
@@ -20,7 +20,7 @@
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/dec_esp.c linux/drivers/scsi/dec_esp.c
--- linux-2.4.2-pre2/drivers/scsi/dec_esp.c	Sun Jul  9 22:22:57 2000
+++ linux/drivers/scsi/dec_esp.c	Mon Dec  3 22:28:21 2001
@@ -15,7 +15,7 @@
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/eata_dma.c linux/drivers/scsi/eata_dma.c
--- linux-2.4.2-pre2/drivers/scsi/eata_dma.c	Sun Dec 31 10:26:18 2000
+++ linux/drivers/scsi/eata_dma.c	Mon Dec  3 22:28:21 2001
@@ -68,7 +68,7 @@
 #include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/in.h>
 #include <linux/pci.h>
 #include <linux/proc_fs.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/eata_pio.c linux/drivers/scsi/eata_pio.c
--- linux-2.4.2-pre2/drivers/scsi/eata_pio.c	Sat Nov 11 19:01:11 2000
+++ linux/drivers/scsi/eata_pio.c	Mon Dec  3 22:28:21 2001
@@ -43,7 +43,7 @@
 #include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/in.h>
 #include <linux/pci.h>
 #include <linux/proc_fs.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/esp.c linux/drivers/scsi/esp.c
--- linux-2.4.2-pre2/drivers/scsi/esp.c	Thu Nov  9 15:57:41 2000
+++ linux/drivers/scsi/esp.c	Mon Dec  3 22:28:21 2001
@@ -18,7 +18,7 @@
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/fastlane.c linux/drivers/scsi/fastlane.c
--- linux-2.4.2-pre2/drivers/scsi/fastlane.c	Mon Oct 16 12:51:16 2000
+++ linux/drivers/scsi/fastlane.c	Mon Dec  3 22:28:21 2001
@@ -29,7 +29,7 @@
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/fcal.c linux/drivers/scsi/fcal.c
--- linux-2.4.2-pre2/drivers/scsi/fcal.c	Sat Nov 11 19:01:11 2000
+++ linux/drivers/scsi/fcal.c	Mon Dec  3 22:28:21 2001
@@ -8,7 +8,7 @@
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/ide-scsi.c linux/drivers/scsi/ide-scsi.c
--- linux-2.4.2-pre2/drivers/scsi/ide-scsi.c	Mon Nov 27 17:57:34 2000
+++ linux/drivers/scsi/ide-scsi.c	Mon Dec  3 22:28:21 2001
@@ -40,7 +40,7 @@
 #include <linux/blkdev.h>
 #include <linux/errno.h>
 #include <linux/hdreg.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ide.h>
 
 #include <asm/io.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/ini9100u.c linux/drivers/scsi/ini9100u.c
--- linux-2.4.2-pre2/drivers/scsi/ini9100u.c	Sat Nov 11 19:01:11 2000
+++ linux/drivers/scsi/ini9100u.c	Mon Dec  3 22:28:21 2001
@@ -136,7 +136,7 @@
 #include "scsi.h"
 #include "sd.h"
 #include "hosts.h"
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include "ini9100u.h"
 
 #ifdef DEBUG_i91u
diff -urN linux-2.4.2-pre2/drivers/scsi/inia100.c linux/drivers/scsi/inia100.c
--- linux-2.4.2-pre2/drivers/scsi/inia100.c	Sat Nov 11 19:01:11 2000
+++ linux/drivers/scsi/inia100.c	Mon Dec  3 22:28:21 2001
@@ -89,7 +89,7 @@
 #include "scsi.h"
 #include "sd.h"
 #include "hosts.h"
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include "inia100.h"
 
 static Scsi_Host_Template driver_template = INIA100;
diff -urN linux-2.4.2-pre2/drivers/scsi/ips.c linux/drivers/scsi/ips.c
--- linux-2.4.2-pre2/drivers/scsi/ips.c	Wed Nov  8 17:09:50 2000
+++ linux/drivers/scsi/ips.c	Mon Dec  3 22:28:21 2001
@@ -123,7 +123,7 @@
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/sched.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/jazz_esp.c linux/drivers/scsi/jazz_esp.c
--- linux-2.4.2-pre2/drivers/scsi/jazz_esp.c	Thu Feb 24 22:51:47 2000
+++ linux/drivers/scsi/jazz_esp.c	Mon Dec  3 22:28:21 2001
@@ -10,7 +10,7 @@
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/mac53c94.c linux/drivers/scsi/mac53c94.c
--- linux-2.4.2-pre2/drivers/scsi/mac53c94.c	Sat Nov 11 19:01:11 2000
+++ linux/drivers/scsi/mac53c94.c	Mon Dec  3 22:28:21 2001
@@ -11,7 +11,7 @@
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/mac_esp.c linux/drivers/scsi/mac_esp.c
--- linux-2.4.2-pre2/drivers/scsi/mac_esp.c	Thu Jan  4 13:00:55 2001
+++ linux/drivers/scsi/mac_esp.c	Mon Dec  3 22:28:21 2001
@@ -18,7 +18,7 @@
 #include <linux/types.h>
 #include <linux/ctype.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/mca_53c9x.c linux/drivers/scsi/mca_53c9x.c
--- linux-2.4.2-pre2/drivers/scsi/mca_53c9x.c	Mon Sep 18 13:36:25 2000
+++ linux/drivers/scsi/mca_53c9x.c	Mon Dec  3 22:28:21 2001
@@ -34,7 +34,7 @@
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/mesh.c linux/drivers/scsi/mesh.c
--- linux-2.4.2-pre2/drivers/scsi/mesh.c	Tue Sep 19 08:31:53 2000
+++ linux/drivers/scsi/mesh.c	Mon Dec  3 22:28:21 2001
@@ -12,7 +12,7 @@
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/ncr53c8xx.c linux/drivers/scsi/ncr53c8xx.c
--- linux-2.4.2-pre2/drivers/scsi/ncr53c8xx.c	Mon Sep 18 13:36:25 2000
+++ linux/drivers/scsi/ncr53c8xx.c	Mon Dec  3 22:28:21 2001
@@ -136,7 +136,7 @@
 #include <linux/errno.h>
 #include <linux/pci.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/ioport.h>
 #include <linux/time.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/oktagon_esp.c linux/drivers/scsi/oktagon_esp.c
--- linux-2.4.2-pre2/drivers/scsi/oktagon_esp.c	Mon Oct 16 12:51:16 2000
+++ linux/drivers/scsi/oktagon_esp.c	Mon Dec  3 22:28:21 2001
@@ -19,7 +19,7 @@
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/pci2220i.c linux/drivers/scsi/pci2220i.c
--- linux-2.4.2-pre2/drivers/scsi/pci2220i.c	Fri Dec 29 14:35:47 2000
+++ linux/drivers/scsi/pci2220i.c	Mon Dec  3 22:28:21 2001
@@ -40,7 +40,7 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pci.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/pcmcia/aha152x_stub.c linux/drivers/scsi/pcmcia/aha152x_stub.c
--- linux-2.4.2-pre2/drivers/scsi/pcmcia/aha152x_stub.c	Sat Sep  2 00:15:37 2000
+++ linux/drivers/scsi/pcmcia/aha152x_stub.c	Mon Dec  3 22:28:21 2001
@@ -38,7 +38,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/ioport.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/pcmcia/apa1480_stub.c linux/drivers/scsi/pcmcia/apa1480_stub.c
--- linux-2.4.2-pre2/drivers/scsi/pcmcia/apa1480_stub.c	Sat Sep  2 00:15:37 2000
+++ linux/drivers/scsi/pcmcia/apa1480_stub.c	Mon Dec  3 22:28:21 2001
@@ -35,7 +35,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/ioport.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/pcmcia/fdomain_stub.c linux/drivers/scsi/pcmcia/fdomain_stub.c
--- linux-2.4.2-pre2/drivers/scsi/pcmcia/fdomain_stub.c	Sat Sep  2 00:15:37 2000
+++ linux/drivers/scsi/pcmcia/fdomain_stub.c	Mon Dec  3 22:28:21 2001
@@ -35,7 +35,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/ioport.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/pcmcia/qlogic_stub.c linux/drivers/scsi/pcmcia/qlogic_stub.c
--- linux-2.4.2-pre2/drivers/scsi/pcmcia/qlogic_stub.c	Sat Sep  2 00:15:37 2000
+++ linux/drivers/scsi/pcmcia/qlogic_stub.c	Mon Dec  3 22:28:21 2001
@@ -35,7 +35,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/ioport.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/pluto.c linux/drivers/scsi/pluto.c
--- linux-2.4.2-pre2/drivers/scsi/pluto.c	Sat Nov 11 19:01:11 2000
+++ linux/drivers/scsi/pluto.c	Mon Dec  3 22:28:21 2001
@@ -8,7 +8,7 @@
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/qla1280.c linux/drivers/scsi/qla1280.c
--- linux-2.4.2-pre2/drivers/scsi/qla1280.c	Wed Dec  6 12:06:18 2000
+++ linux/drivers/scsi/qla1280.c	Mon Dec  3 22:28:21 2001
@@ -220,7 +220,7 @@
 #include "ql1280_fw.h"
 
 #include <linux/stat.h>
-#include <linux/malloc.h>        /* for kmalloc() */
+#include <linux/slab.h>        /* for kmalloc() */
 
 
 #ifndef KERNEL_VERSION
diff -urN linux-2.4.2-pre2/drivers/scsi/qlogicpti.c linux/drivers/scsi/qlogicpti.c
--- linux-2.4.2-pre2/drivers/scsi/qlogicpti.c	Mon Sep 18 13:36:25 2000
+++ linux/drivers/scsi/qlogicpti.c	Mon Dec  3 22:28:21 2001
@@ -16,7 +16,7 @@
 #include <linux/delay.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/scsi.c linux/drivers/scsi/scsi.c
--- linux-2.4.2-pre2/drivers/scsi/scsi.c	Mon Oct 30 14:44:29 2000
+++ linux/drivers/scsi/scsi.c	Mon Dec  3 22:28:21 2001
@@ -45,7 +45,7 @@
 #include <linux/sched.h>
 #include <linux/timer.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/scsi_error.c linux/drivers/scsi/scsi_error.c
--- linux-2.4.2-pre2/drivers/scsi/scsi_error.c	Wed Nov  8 17:09:50 2000
+++ linux/drivers/scsi/scsi_error.c	Mon Dec  3 22:28:21 2001
@@ -14,7 +14,7 @@
 #include <linux/sched.h>
 #include <linux/timer.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/scsi_lib.c linux/drivers/scsi/scsi_lib.c
--- linux-2.4.2-pre2/drivers/scsi/scsi_lib.c	Mon Jan 15 16:52:57 2001
+++ linux/drivers/scsi/scsi_lib.c	Mon Dec  3 22:28:21 2001
@@ -23,7 +23,7 @@
 #include <linux/sched.h>
 #include <linux/timer.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/scsi_merge.c linux/drivers/scsi/scsi_merge.c
--- linux-2.4.2-pre2/drivers/scsi/scsi_merge.c	Mon Jan 15 13:08:15 2001
+++ linux/drivers/scsi/scsi_merge.c	Mon Dec  3 22:28:21 2001
@@ -39,7 +39,7 @@
 #include <linux/sched.h>
 #include <linux/timer.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/scsi_obsolete.c linux/drivers/scsi/scsi_obsolete.c
--- linux-2.4.2-pre2/drivers/scsi/scsi_obsolete.c	Thu Nov  9 15:57:41 2000
+++ linux/drivers/scsi/scsi_obsolete.c	Mon Dec  3 22:28:21 2001
@@ -52,7 +52,7 @@
 #include <linux/sched.h>
 #include <linux/timer.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/scsi_proc.c linux/drivers/scsi/scsi_proc.c
--- linux-2.4.2-pre2/drivers/scsi/scsi_proc.c	Mon Dec 20 22:05:10 1999
+++ linux/drivers/scsi/scsi_proc.c	Mon Dec  3 22:28:21 2001
@@ -22,7 +22,7 @@
 
 #include <linux/string.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/proc_fs.h>
 #include <linux/errno.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/scsi_queue.c linux/drivers/scsi/scsi_queue.c
--- linux-2.4.2-pre2/drivers/scsi/scsi_queue.c	Sun Sep 17 10:09:29 2000
+++ linux/drivers/scsi/scsi_queue.c	Mon Dec  3 22:28:21 2001
@@ -16,7 +16,7 @@
 #include <linux/sched.h>
 #include <linux/timer.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/scsi_syms.c linux/drivers/scsi/scsi_syms.c
--- linux-2.4.2-pre2/drivers/scsi/scsi_syms.c	Wed Sep 20 13:11:53 2000
+++ linux/drivers/scsi/scsi_syms.c	Mon Dec  3 22:28:21 2001
@@ -9,7 +9,7 @@
 #include <linux/sched.h>
 #include <linux/timer.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/blk.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/sun3x_esp.c linux/drivers/scsi/sun3x_esp.c
--- linux-2.4.2-pre2/drivers/scsi/sun3x_esp.c	Thu Jan  4 13:00:55 2001
+++ linux/drivers/scsi/sun3x_esp.c	Mon Dec  3 22:28:21 2001
@@ -8,7 +8,7 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blk.h>
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/sym53c8xx.c linux/drivers/scsi/sym53c8xx.c
--- linux-2.4.2-pre2/drivers/scsi/sym53c8xx.c	Mon Jan  1 10:23:21 2001
+++ linux/drivers/scsi/sym53c8xx.c	Mon Dec  3 22:28:21 2001
@@ -126,7 +126,7 @@
 #include <linux/errno.h>
 #include <linux/pci.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/ioport.h>
 #include <linux/time.h>
diff -urN linux-2.4.2-pre2/drivers/scsi/wd7000.c linux/drivers/scsi/wd7000.c
--- linux-2.4.2-pre2/drivers/scsi/wd7000.c	Sat Nov 11 19:01:11 2000
+++ linux/drivers/scsi/wd7000.c	Mon Dec  3 22:28:21 2001
@@ -151,7 +151,7 @@
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <asm/system.h>
 #include <asm/dma.h>
diff -urN linux-2.4.2-pre2/drivers/sgi/char/ds1286.c linux/drivers/sgi/char/ds1286.c
--- linux-2.4.2-pre2/drivers/sgi/char/ds1286.c	Wed Jul 12 21:58:43 2000
+++ linux/drivers/sgi/char/ds1286.c	Mon Dec  3 22:28:21 2001
@@ -31,7 +31,7 @@
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/fcntl.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/sgi/char/graphics.c linux/drivers/sgi/char/graphics.c
--- linux-2.4.2-pre2/drivers/sgi/char/graphics.c	Tue Aug 29 14:09:15 2000
+++ linux/drivers/sgi/char/graphics.c	Mon Dec  3 22:28:21 2001
@@ -31,7 +31,7 @@
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/mman.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/smp_lock.h>
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/drivers/sound/cmpci.c linux/drivers/sound/cmpci.c
--- linux-2.4.2-pre2/drivers/sound/cmpci.c	Fri Dec 29 14:35:47 2000
+++ linux/drivers/sound/cmpci.c	Mon Dec  3 22:28:21 2001
@@ -106,7 +106,7 @@
 #include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/sound.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/soundcard.h>
 #include <linux/pci.h>
 #include <linux/wrapper.h>
diff -urN linux-2.4.2-pre2/drivers/sound/cs46xx.c linux/drivers/sound/cs46xx.c
--- linux-2.4.2-pre2/drivers/sound/cs46xx.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/sound/cs46xx.c	Mon Dec  3 22:28:21 2001
@@ -58,7 +58,7 @@
 #include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/sound.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/soundcard.h>
 #include <linux/pci.h>
 #ifdef CS46XX_PM
diff -urN linux-2.4.2-pre2/drivers/sound/dmasound/dmasound_awacs.c linux/drivers/sound/dmasound/dmasound_awacs.c
--- linux-2.4.2-pre2/drivers/sound/dmasound/dmasound_awacs.c	Sun Sep 17 09:48:05 2000
+++ linux/drivers/sound/dmasound/dmasound_awacs.c	Mon Dec  3 22:28:21 2001
@@ -10,12 +10,13 @@
 
 #include <linux/module.h>
 #include <linux/config.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/soundcard.h>
 #include <linux/adb.h>
 #include <linux/nvram.h>
+#include <linux/tty.h>
 #include <linux/vt_kern.h>
 #ifdef CONFIG_ADB_CUDA
 #include <linux/cuda.h>
diff -urN linux-2.4.2-pre2/drivers/sound/dmasound/dmasound_core.c linux/drivers/sound/dmasound/dmasound_core.c
--- linux-2.4.2-pre2/drivers/sound/dmasound/dmasound_core.c	Sat Nov 11 18:19:56 2000
+++ linux/drivers/sound/dmasound/dmasound_core.c	Mon Dec  3 22:28:21 2001
@@ -107,7 +107,7 @@
 
 
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sound.h>
 #include <linux/init.h>
 #include <linux/soundcard.h>
diff -urN linux-2.4.2-pre2/drivers/sound/dmasound/dmasound_q40.c linux/drivers/sound/dmasound/dmasound_q40.c
--- linux-2.4.2-pre2/drivers/sound/dmasound/dmasound_q40.c	Tue Apr 25 17:58:46 2000
+++ linux/drivers/sound/dmasound/dmasound_q40.c	Mon Dec  3 22:28:21 2001
@@ -10,7 +10,7 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/soundcard.h>
 
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/drivers/sound/emu10k1/audio.c linux/drivers/sound/emu10k1/audio.c
--- linux-2.4.2-pre2/drivers/sound/emu10k1/audio.c	Wed Jan 17 13:27:37 2001
+++ linux/drivers/sound/emu10k1/audio.c	Mon Dec  3 22:28:21 2001
@@ -33,7 +33,7 @@
 #define __NO_VERSION__
 #include <linux/module.h>
 #include <linux/poll.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/version.h>
 #include <linux/bitops.h>
 #include <asm/io.h>
diff -urN linux-2.4.2-pre2/drivers/sound/emu10k1/cardmi.c linux/drivers/sound/emu10k1/cardmi.c
--- linux-2.4.2-pre2/drivers/sound/emu10k1/cardmi.c	Mon Aug 14 08:32:48 2000
+++ linux/drivers/sound/emu10k1/cardmi.c	Mon Dec  3 22:28:21 2001
@@ -31,7 +31,7 @@
  **********************************************************************
  */
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 
 #include "hwaccess.h"
diff -urN linux-2.4.2-pre2/drivers/sound/emu10k1/cardmo.c linux/drivers/sound/emu10k1/cardmo.c
--- linux-2.4.2-pre2/drivers/sound/emu10k1/cardmo.c	Mon Aug 14 08:32:48 2000
+++ linux/drivers/sound/emu10k1/cardmo.c	Mon Dec  3 22:28:21 2001
@@ -31,7 +31,7 @@
  ********************************************************************** 
  */
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include "hwaccess.h"
 #include "8010.h"
diff -urN linux-2.4.2-pre2/drivers/sound/emu10k1/main.c linux/drivers/sound/emu10k1/main.c
--- linux-2.4.2-pre2/drivers/sound/emu10k1/main.c	Thu Sep 21 13:25:09 2000
+++ linux/drivers/sound/emu10k1/main.c	Mon Dec  3 22:28:21 2001
@@ -52,7 +52,7 @@
 /* These are only included once per module */
 #include <linux/version.h>
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 
diff -urN linux-2.4.2-pre2/drivers/sound/emu10k1/midi.c linux/drivers/sound/emu10k1/midi.c
--- linux-2.4.2-pre2/drivers/sound/emu10k1/midi.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/sound/emu10k1/midi.c	Mon Dec  3 22:28:21 2001
@@ -32,7 +32,7 @@
 
 #define __NO_VERSION__
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/version.h>
 #include <linux/sched.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.4.2-pre2/drivers/sound/es1370.c linux/drivers/sound/es1370.c
--- linux-2.4.2-pre2/drivers/sound/es1370.c	Fri Dec 29 14:35:47 2000
+++ linux/drivers/sound/es1370.c	Mon Dec  3 22:28:21 2001
@@ -146,7 +146,7 @@
 #include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/sound.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/soundcard.h>
 #include <linux/pci.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.4.2-pre2/drivers/sound/es1371.c linux/drivers/sound/es1371.c
--- linux-2.4.2-pre2/drivers/sound/es1371.c	Fri Dec 29 14:35:47 2000
+++ linux/drivers/sound/es1371.c	Mon Dec  3 22:28:21 2001
@@ -113,7 +113,7 @@
 #include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/sound.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/soundcard.h>
 #include <linux/pci.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/sound/esssolo1.c linux/drivers/sound/esssolo1.c
--- linux-2.4.2-pre2/drivers/sound/esssolo1.c	Fri Dec 29 14:35:47 2000
+++ linux/drivers/sound/esssolo1.c	Mon Dec  3 22:28:21 2001
@@ -81,7 +81,7 @@
 #include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/sound.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/soundcard.h>
 #include <linux/pci.h>
 #include <linux/bitops.h>
diff -urN linux-2.4.2-pre2/drivers/sound/i810_audio.c linux/drivers/sound/i810_audio.c
--- linux-2.4.2-pre2/drivers/sound/i810_audio.c	Thu Jan  4 12:50:17 2001
+++ linux/drivers/sound/i810_audio.c	Mon Dec  3 22:28:21 2001
@@ -73,7 +73,7 @@
 #include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/sound.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/soundcard.h>
 #include <linux/pci.h>
 #include <asm/io.h>
diff -urN linux-2.4.2-pre2/drivers/sound/maestro.c linux/drivers/sound/maestro.c
--- linux-2.4.2-pre2/drivers/sound/maestro.c	Fri Dec 29 14:35:47 2000
+++ linux/drivers/sound/maestro.c	Mon Dec  3 22:28:21 2001
@@ -231,7 +231,7 @@
 #include <linux/ioport.h>
 #include <linux/delay.h>
 #include <linux/sound.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/soundcard.h>
 #include <linux/pci.h>
 #include <linux/spinlock.h>
diff -urN linux-2.4.2-pre2/drivers/sound/maestro3.c linux/drivers/sound/maestro3.c
--- linux-2.4.2-pre2/drivers/sound/maestro3.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/sound/maestro3.c	Mon Dec  3 22:28:21 2001
@@ -28,6 +28,8 @@
  * Shouts go out to Mike "DJ XPCom" Ang.
  *
  * History
+ *  v1.21 - Feb 04 2001 - Zach Brown <zab@zabbo.net>
+ *   fix up really dumb notifier -> suspend oops
  *  v1.20 - Jan 30 2001 - Zach Brown <zab@zabbo.net>
  *   get rid of pm callback and use pci_dev suspend/resume instead
  *   m3_probe cleanups, including pm oops think-o
@@ -147,7 +149,7 @@
 
 #define M_DEBUG 1
 
-#define DRIVER_VERSION      "1.20"
+#define DRIVER_VERSION      "1.21"
 #define M3_MODULE_NAME      "maestro3"
 #define PFX                 M3_MODULE_NAME ": "
 
@@ -2763,7 +2765,6 @@
 static void m3_suspend(struct pci_dev *pci_dev)
 {
     unsigned long flags;
-    int index;
     int i;
     struct m3_card *card = pci_dev->driver_data;
 
@@ -2788,15 +2789,18 @@
 
     m3_assp_halt(card);
 
-    index = 0;
-    DPRINTK(DPMOD, "saving code\n");
-    for(i = REV_B_CODE_MEMORY_BEGIN ; i <= REV_B_CODE_MEMORY_END; i++)
-        card->suspend_mem[index++] = 
-            m3_assp_read(card, MEMTYPE_INTERNAL_CODE, i);
-    DPRINTK(DPMOD, "saving data\n");
-    for(i = REV_B_DATA_MEMORY_BEGIN ; i <= REV_B_DATA_MEMORY_END; i++)
-        card->suspend_mem[index++] = 
-            m3_assp_read(card, MEMTYPE_INTERNAL_DATA, i);
+    if(card->suspend_mem) {
+        int index = 0;
+
+        DPRINTK(DPMOD, "saving code\n");
+        for(i = REV_B_CODE_MEMORY_BEGIN ; i <= REV_B_CODE_MEMORY_END; i++)
+            card->suspend_mem[index++] = 
+                m3_assp_read(card, MEMTYPE_INTERNAL_CODE, i);
+        DPRINTK(DPMOD, "saving data\n");
+        for(i = REV_B_DATA_MEMORY_BEGIN ; i <= REV_B_DATA_MEMORY_END; i++)
+            card->suspend_mem[index++] = 
+                m3_assp_read(card, MEMTYPE_INTERNAL_DATA, i);
+    }
 
     DPRINTK(DPMOD, "powering down apci regs\n");
     m3_outw(card, 0xffff, 0x54);
diff -urN linux-2.4.2-pre2/drivers/sound/msnd.c linux/drivers/sound/msnd.c
--- linux-2.4.2-pre2/drivers/sound/msnd.c	Sat Nov 11 18:33:14 2000
+++ linux/drivers/sound/msnd.c	Mon Dec  3 22:28:21 2001
@@ -30,7 +30,7 @@
 #endif
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/types.h>
 #include <linux/delay.h>
diff -urN linux-2.4.2-pre2/drivers/sound/msnd_pinnacle.c linux/drivers/sound/msnd_pinnacle.c
--- linux-2.4.2-pre2/drivers/sound/msnd_pinnacle.c	Sat Nov 11 18:33:14 2000
+++ linux/drivers/sound/msnd_pinnacle.c	Mon Dec  3 22:28:21 2001
@@ -37,7 +37,7 @@
 #include <linux/config.h>
 #include <linux/version.h>
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/delay.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/sound/os.h linux/drivers/sound/os.h
--- linux-2.4.2-pre2/drivers/sound/os.h	Mon Jan 29 23:26:25 2001
+++ linux/drivers/sound/os.h	Mon Dec  3 22:28:21 2001
@@ -20,7 +20,7 @@
 #include <asm/param.h>
 #include <linux/ptrace.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <asm/page.h>
 #include <asm/system.h>
diff -urN linux-2.4.2-pre2/drivers/sound/sonicvibes.c linux/drivers/sound/sonicvibes.c
--- linux-2.4.2-pre2/drivers/sound/sonicvibes.c	Fri Dec 29 14:35:47 2000
+++ linux/drivers/sound/sonicvibes.c	Mon Dec  3 22:28:21 2001
@@ -100,7 +100,7 @@
 #include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/sound.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/soundcard.h>
 #include <linux/pci.h>
 #include <asm/io.h>
diff -urN linux-2.4.2-pre2/drivers/sound/sound_core.c linux/drivers/sound/sound_core.c
--- linux-2.4.2-pre2/drivers/sound/sound_core.c	Sun Dec  3 17:45:23 2000
+++ linux/drivers/sound/sound_core.c	Mon Dec  3 22:28:21 2001
@@ -37,7 +37,7 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/fs.h>
diff -urN linux-2.4.2-pre2/drivers/sound/sound_firmware.c linux/drivers/sound/sound_firmware.c
--- linux-2.4.2-pre2/drivers/sound/sound_firmware.c	Tue Mar 14 17:54:42 2000
+++ linux/drivers/sound/sound_firmware.c	Mon Dec  3 22:28:21 2001
@@ -3,7 +3,7 @@
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/unistd.h>
 #include <asm/uaccess.h>
 
diff -urN linux-2.4.2-pre2/drivers/sound/soundcard.c linux/drivers/sound/soundcard.c
--- linux-2.4.2-pre2/drivers/sound/soundcard.c	Mon Sep 25 12:32:54 2000
+++ linux/drivers/sound/soundcard.c	Mon Dec  3 22:28:21 2001
@@ -37,7 +37,7 @@
 #include <asm/io.h>
 #include <asm/segment.h>
 #include <linux/wait.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/devfs_fs_kernel.h>
 #include <linux/major.h>
diff -urN linux-2.4.2-pre2/drivers/sound/sscape.c linux/drivers/sound/sscape.c
--- linux-2.4.2-pre2/drivers/sound/sscape.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/sound/sscape.c	Mon Dec  3 22:28:21 2001
@@ -36,7 +36,7 @@
 #include <asm/io.h>
 #include <asm/segment.h>
 #include <linux/wait.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
 #include <linux/proc_fs.h>
diff -urN linux-2.4.2-pre2/drivers/sound/trident.c linux/drivers/sound/trident.c
--- linux-2.4.2-pre2/drivers/sound/trident.c	Fri Dec 29 14:35:47 2000
+++ linux/drivers/sound/trident.c	Mon Dec  3 22:28:21 2001
@@ -108,7 +108,7 @@
 #include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/sound.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/soundcard.h>
 #include <linux/pci.h>
 #include <asm/io.h>
diff -urN linux-2.4.2-pre2/drivers/sound/wavfront.c linux/drivers/sound/wavfront.c
--- linux-2.4.2-pre2/drivers/sound/wavfront.c	Sun Dec 31 10:26:18 2000
+++ linux/drivers/sound/wavfront.c	Mon Dec  3 22:28:21 2001
@@ -2534,7 +2534,7 @@
 #define __KERNEL_SYSCALLS__
 #include <linux/fs.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/unistd.h>
 #include <asm/uaccess.h>
 
diff -urN linux-2.4.2-pre2/drivers/telephony/ixj.c linux/drivers/telephony/ixj.c
--- linux-2.4.2-pre2/drivers/telephony/ixj.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/telephony/ixj.c	Mon Dec  3 22:28:21 2001
@@ -53,7 +53,7 @@
 #include <linux/kernel.h>	/* printk() */
 #include <linux/fs.h>		/* everything... */
 #include <linux/errno.h>	/* error codes */
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/usb/acm.c linux/drivers/usb/acm.c
--- linux-2.4.2-pre2/drivers/usb/acm.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/acm.c	Mon Dec  3 22:28:21 2001
@@ -45,8 +45,9 @@
 #include <linux/errno.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
+#include <linux/tty.h>
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
 #include <linux/tty.h>
diff -urN linux-2.4.2-pre2/drivers/usb/audio.c linux/drivers/usb/audio.c
--- linux-2.4.2-pre2/drivers/usb/audio.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/audio.c	Mon Dec  3 22:28:21 2001
@@ -170,7 +170,7 @@
 
 #include <linux/version.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/sched.h>
diff -urN linux-2.4.2-pre2/drivers/usb/bluetooth.c linux/drivers/usb/bluetooth.c
--- linux-2.4.2-pre2/drivers/usb/bluetooth.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/bluetooth.c	Mon Dec  3 22:28:21 2001
@@ -75,11 +75,11 @@
 #include <linux/errno.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
+#include <linux/tty.h>
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
-#include <linux/tty.h>
 #include <linux/module.h>
 
 #define DEBUG
diff -urN linux-2.4.2-pre2/drivers/usb/dc2xx.c linux/drivers/usb/dc2xx.c
--- linux-2.4.2-pre2/drivers/usb/dc2xx.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/dc2xx.c	Mon Dec  3 22:28:21 2001
@@ -60,7 +60,7 @@
 #include <linux/random.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 
 #ifdef CONFIG_USB_DEBUG
diff -urN linux-2.4.2-pre2/drivers/usb/dsbr100.c linux/drivers/usb/dsbr100.c
--- linux-2.4.2-pre2/drivers/usb/dsbr100.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/dsbr100.c	Mon Dec  3 22:28:21 2001
@@ -60,7 +60,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/input.h>
 #include <linux/videodev.h>
 #include <linux/usb.h>
diff -urN linux-2.4.2-pre2/drivers/usb/hid.c linux/drivers/usb/hid.c
--- linux-2.4.2-pre2/drivers/usb/hid.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/hid.c	Mon Dec  3 22:28:21 2001
@@ -30,7 +30,7 @@
  */
 
 #include <linux/module.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/input.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
diff -urN linux-2.4.2-pre2/drivers/usb/hid.h linux/drivers/usb/hid.h
--- linux-2.4.2-pre2/drivers/usb/hid.h	Mon Dec 11 13:17:49 2000
+++ linux/drivers/usb/hid.h	Mon Dec  3 22:28:21 2001
@@ -31,7 +31,7 @@
  */
 
 #include <linux/types.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/list.h>
 
 /*
diff -urN linux-2.4.2-pre2/drivers/usb/hub.c linux/drivers/usb/hub.c
--- linux-2.4.2-pre2/drivers/usb/hub.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/hub.c	Mon Dec  3 22:28:21 2001
@@ -11,7 +11,7 @@
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/list.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/smp_lock.h>
 #ifdef CONFIG_USB_DEBUG
 	#define DEBUG
diff -urN linux-2.4.2-pre2/drivers/usb/ibmcam.c linux/drivers/usb/ibmcam.c
--- linux-2.4.2-pre2/drivers/usb/ibmcam.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/ibmcam.c	Mon Dec  3 22:28:21 2001
@@ -28,7 +28,7 @@
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/list.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/smp_lock.h>
 #include <linux/videodev.h>
diff -urN linux-2.4.2-pre2/drivers/usb/mdc800.c linux/drivers/usb/mdc800.c
--- linux-2.4.2-pre2/drivers/usb/mdc800.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/mdc800.c	Mon Dec  3 22:28:21 2001
@@ -84,7 +84,7 @@
 #include <linux/random.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/smp_lock.h>
 
diff -urN linux-2.4.2-pre2/drivers/usb/microtek.c linux/drivers/usb/microtek.c
--- linux-2.4.2-pre2/drivers/usb/microtek.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/microtek.c	Mon Dec  3 22:28:21 2001
@@ -114,7 +114,7 @@
 #include <linux/random.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
 #include <linux/usb.h>
diff -urN linux-2.4.2-pre2/drivers/usb/pegasus.c linux/drivers/usb/pegasus.c
--- linux-2.4.2-pre2/drivers/usb/pegasus.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/pegasus.c	Mon Dec  3 22:28:21 2001
@@ -41,7 +41,7 @@
 
 
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/netdevice.h>
diff -urN linux-2.4.2-pre2/drivers/usb/printer.c linux/drivers/usb/printer.c
--- linux-2.4.2-pre2/drivers/usb/printer.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/printer.c	Mon Dec  3 22:28:21 2001
@@ -42,7 +42,7 @@
 #include <linux/signal.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/lp.h>
 #undef DEBUG
 #include <linux/usb.h>
diff -urN linux-2.4.2-pre2/drivers/usb/rio500.c linux/drivers/usb/rio500.c
--- linux-2.4.2-pre2/drivers/usb/rio500.c	Tue Jan 16 14:29:54 2001
+++ linux/drivers/usb/rio500.c	Mon Dec  3 22:28:21 2001
@@ -33,7 +33,7 @@
 #include <linux/random.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/usb.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.4.2-pre2/drivers/usb/scanner.h linux/drivers/usb/scanner.h
--- linux-2.4.2-pre2/drivers/usb/scanner.h	Mon Dec 11 13:17:51 2000
+++ linux/drivers/usb/scanner.h	Mon Dec  3 22:28:21 2001
@@ -26,7 +26,7 @@
 #include <linux/errno.h>
 #include <asm/uaccess.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/ioctl.h>
 #include <linux/sched.h>
diff -urN linux-2.4.2-pre2/drivers/usb/serial/belkin_sa.c linux/drivers/usb/serial/belkin_sa.c
--- linux-2.4.2-pre2/drivers/usb/serial/belkin_sa.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/serial/belkin_sa.c	Mon Dec  3 22:28:21 2001
@@ -57,11 +57,11 @@
 #include <linux/errno.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
+#include <linux/tty.h>
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
-#include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 
diff -urN linux-2.4.2-pre2/drivers/usb/serial/digi_acceleport.c linux/drivers/usb/serial/digi_acceleport.c
--- linux-2.4.2-pre2/drivers/usb/serial/digi_acceleport.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/serial/digi_acceleport.c	Mon Dec  3 22:28:21 2001
@@ -233,11 +233,11 @@
 #include <linux/errno.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
+#include <linux/tty.h>
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
-#include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/tqueue.h>
diff -urN linux-2.4.2-pre2/drivers/usb/serial/empeg.c linux/drivers/usb/serial/empeg.c
--- linux-2.4.2-pre2/drivers/usb/serial/empeg.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/usb/serial/empeg.c	Mon Dec  3 22:28:21 2001
@@ -48,11 +48,11 @@
 #include <linux/errno.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
+#include <linux/tty.h>
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
-#include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #ifdef CONFIG_USB_SERIAL_DEBUG
diff -urN linux-2.4.2-pre2/drivers/usb/serial/ftdi_sio.c linux/drivers/usb/serial/ftdi_sio.c
--- linux-2.4.2-pre2/drivers/usb/serial/ftdi_sio.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/serial/ftdi_sio.c	Mon Dec  3 22:28:21 2001
@@ -71,11 +71,11 @@
 #include <linux/errno.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
+#include <linux/tty.h>
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
-#include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 
diff -urN linux-2.4.2-pre2/drivers/usb/serial/keyspan.c linux/drivers/usb/serial/keyspan.c
--- linux-2.4.2-pre2/drivers/usb/serial/keyspan.c	Mon Dec 11 13:47:32 2000
+++ linux/drivers/usb/serial/keyspan.c	Mon Dec  3 22:28:21 2001
@@ -55,11 +55,11 @@
 #include <linux/errno.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
+#include <linux/tty.h>
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
-#include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 
diff -urN linux-2.4.2-pre2/drivers/usb/serial/keyspan_pda.c linux/drivers/usb/serial/keyspan_pda.c
--- linux-2.4.2-pre2/drivers/usb/serial/keyspan_pda.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/serial/keyspan_pda.c	Mon Dec  3 22:28:21 2001
@@ -59,11 +59,11 @@
 #include <linux/errno.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
+#include <linux/tty.h>
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
-#include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/tqueue.h>
diff -urN linux-2.4.2-pre2/drivers/usb/serial/mct_u232.c linux/drivers/usb/serial/mct_u232.c
--- linux-2.4.2-pre2/drivers/usb/serial/mct_u232.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/usb/serial/mct_u232.c	Mon Dec  3 22:28:21 2001
@@ -46,11 +46,11 @@
 #include <linux/errno.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
+#include <linux/tty.h>
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
-#include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 
diff -urN linux-2.4.2-pre2/drivers/usb/serial/omninet.c linux/drivers/usb/serial/omninet.c
--- linux-2.4.2-pre2/drivers/usb/serial/omninet.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/serial/omninet.c	Mon Dec  3 22:28:21 2001
@@ -36,11 +36,11 @@
 #include <linux/errno.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
+#include <linux/tty.h>
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
-#include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 
diff -urN linux-2.4.2-pre2/drivers/usb/serial/usbserial.c linux/drivers/usb/serial/usbserial.c
--- linux-2.4.2-pre2/drivers/usb/serial/usbserial.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/usb/serial/usbserial.c	Mon Dec  3 22:28:21 2001
@@ -263,11 +263,11 @@
 #include <linux/errno.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
+#include <linux/tty.h>
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
-#include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 #include <linux/list.h>
diff -urN linux-2.4.2-pre2/drivers/usb/serial/visor.c linux/drivers/usb/serial/visor.c
--- linux-2.4.2-pre2/drivers/usb/serial/visor.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/usb/serial/visor.c	Mon Dec  3 22:28:21 2001
@@ -85,11 +85,11 @@
 #include <linux/errno.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
+#include <linux/tty.h>
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
-#include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 
diff -urN linux-2.4.2-pre2/drivers/usb/serial/whiteheat.c linux/drivers/usb/serial/whiteheat.c
--- linux-2.4.2-pre2/drivers/usb/serial/whiteheat.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/serial/whiteheat.c	Mon Dec  3 22:28:21 2001
@@ -55,11 +55,11 @@
 #include <linux/errno.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
+#include <linux/tty.h>
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
-#include <linux/tty.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
 
diff -urN linux-2.4.2-pre2/drivers/usb/storage/scsiglue.c linux/drivers/usb/storage/scsiglue.c
--- linux-2.4.2-pre2/drivers/usb/storage/scsiglue.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/usb/storage/scsiglue.c	Mon Dec  3 22:28:21 2001
@@ -49,7 +49,7 @@
 #include "debug.h"
 #include "transport.h"
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 /*
  * kernel thread actions
diff -urN linux-2.4.2-pre2/drivers/usb/storage/sddr09.c linux/drivers/usb/storage/sddr09.c
--- linux-2.4.2-pre2/drivers/usb/storage/sddr09.c	Tue Nov 28 21:50:07 2000
+++ linux/drivers/usb/storage/sddr09.c	Mon Dec  3 22:28:21 2001
@@ -38,7 +38,7 @@
 
 #include <linux/sched.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #define short_pack(lsb,msb) ( ((u16)(lsb)) | ( ((u16)(msb))<<8 ) )
 #define LSB_of(s) ((s)&0xFF)
diff -urN linux-2.4.2-pre2/drivers/usb/storage/shuttle_usbat.c linux/drivers/usb/storage/shuttle_usbat.c
--- linux-2.4.2-pre2/drivers/usb/storage/shuttle_usbat.c	Tue Nov 28 21:50:07 2000
+++ linux/drivers/usb/storage/shuttle_usbat.c	Mon Dec  3 22:28:21 2001
@@ -44,7 +44,7 @@
 
 #include <linux/sched.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 extern int usb_stor_control_msg(struct us_data *us, unsigned int pipe,
 	u8 request, u8 requesttype, u16 value, u16 index,
diff -urN linux-2.4.2-pre2/drivers/usb/storage/transport.c linux/drivers/usb/storage/transport.c
--- linux-2.4.2-pre2/drivers/usb/storage/transport.c	Tue Nov 28 21:50:07 2000
+++ linux/drivers/usb/storage/transport.c	Mon Dec  3 22:28:21 2001
@@ -52,7 +52,7 @@
 
 #include <linux/sched.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 /***********************************************************************
  * Helper routines
diff -urN linux-2.4.2-pre2/drivers/usb/storage/usb.c linux/drivers/usb/storage/usb.c
--- linux-2.4.2-pre2/drivers/usb/storage/usb.c	Tue Jan 16 14:29:54 2001
+++ linux/drivers/usb/storage/usb.c	Mon Dec  3 22:28:21 2001
@@ -70,7 +70,7 @@
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 /* Some informational data */
 MODULE_AUTHOR("Matthew Dharm <mdharm-usb@one-eyed-alien.net>");
diff -urN linux-2.4.2-pre2/drivers/usb/uhci.c linux/drivers/usb/uhci.c
--- linux-2.4.2-pre2/drivers/usb/uhci.c	Thu Dec  7 16:42:28 2000
+++ linux/drivers/usb/uhci.c	Mon Dec  3 22:28:21 2001
@@ -33,7 +33,7 @@
 #include <linux/delay.h>
 #include <linux/ioport.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/errno.h>
 #include <linux/unistd.h>
diff -urN linux-2.4.2-pre2/drivers/usb/usb-debug.c linux/drivers/usb/usb-debug.c
--- linux-2.4.2-pre2/drivers/usb/usb-debug.c	Thu Mar 30 18:00:01 2000
+++ linux/drivers/usb/usb-debug.c	Mon Dec  3 22:28:21 2001
@@ -8,7 +8,7 @@
 #include <linux/version.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #ifdef CONFIG_USB_DEBUG
 	#define DEBUG
 #else
diff -urN linux-2.4.2-pre2/drivers/usb/usb-ohci.c linux/drivers/usb/usb-ohci.c
--- linux-2.4.2-pre2/drivers/usb/usb-ohci.c	Tue Nov 14 23:36:01 2000
+++ linux/drivers/usb/usb-ohci.c	Mon Dec  3 22:28:21 2001
@@ -47,7 +47,7 @@
 #include <linux/delay.h>
 #include <linux/ioport.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/errno.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/usb/usb-uhci.c linux/drivers/usb/usb-uhci.c
--- linux-2.4.2-pre2/drivers/usb/usb-uhci.c	Sat Dec  9 10:14:11 2000
+++ linux/drivers/usb/usb-uhci.c	Mon Dec  3 22:28:21 2001
@@ -26,7 +26,7 @@
 #include <linux/delay.h>
 #include <linux/ioport.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/errno.h>
 #include <linux/unistd.h>
diff -urN linux-2.4.2-pre2/drivers/usb/usb.c linux/drivers/usb/usb.c
--- linux-2.4.2-pre2/drivers/usb/usb.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/usb.c	Mon Dec  3 22:28:21 2001
@@ -26,7 +26,7 @@
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/bitops.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>  /* for in_interrupt() */
 #include <linux/kmod.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/usb/usbkbd.c linux/drivers/usb/usbkbd.c
--- linux-2.4.2-pre2/drivers/usb/usbkbd.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/usbkbd.c	Mon Dec  3 22:28:21 2001
@@ -29,7 +29,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/input.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/usb/usbmouse.c linux/drivers/usb/usbmouse.c
--- linux-2.4.2-pre2/drivers/usb/usbmouse.c	Thu Jan  4 13:15:32 2001
+++ linux/drivers/usb/usbmouse.c	Mon Dec  3 22:28:21 2001
@@ -29,7 +29,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/input.h>
 #include <linux/module.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/usb/wacom.c linux/drivers/usb/wacom.c
--- linux-2.4.2-pre2/drivers/usb/wacom.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/usb/wacom.c	Mon Dec  3 22:28:21 2001
@@ -51,7 +51,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/input.h>
 #include <linux/module.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/video/S3triofb.c linux/drivers/video/S3triofb.c
--- linux-2.4.2-pre2/drivers/video/S3triofb.c	Tue Nov  7 10:59:43 2000
+++ linux/drivers/video/S3triofb.c	Mon Dec  3 22:28:21 2001
@@ -30,7 +30,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/acornfb.c linux/drivers/video/acornfb.c
--- linux-2.4.2-pre2/drivers/video/acornfb.c	Mon Sep 18 15:15:22 2000
+++ linux/drivers/video/acornfb.c	Mon Dec  3 22:28:21 2001
@@ -23,7 +23,7 @@
 #include <linux/ctype.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/fb.h>
 
diff -urN linux-2.4.2-pre2/drivers/video/amifb.c linux/drivers/video/amifb.c
--- linux-2.4.2-pre2/drivers/video/amifb.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/video/amifb.c	Mon Dec  3 22:28:21 2001
@@ -46,7 +46,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/config.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/atafb.c linux/drivers/video/atafb.c
--- linux-2.4.2-pre2/drivers/video/atafb.c	Mon Nov 27 18:00:49 2000
+++ linux/drivers/video/atafb.c	Mon Dec  3 22:28:21 2001
@@ -54,7 +54,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 
diff -urN linux-2.4.2-pre2/drivers/video/aty128fb.c linux/drivers/video/aty128fb.c
--- linux-2.4.2-pre2/drivers/video/aty128fb.c	Sun Dec  3 17:45:23 2000
+++ linux/drivers/video/aty128fb.c	Mon Dec  3 22:28:21 2001
@@ -33,7 +33,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/atyfb.c linux/drivers/video/atyfb.c
--- linux-2.4.2-pre2/drivers/video/atyfb.c	Thu Jan  4 12:38:41 2001
+++ linux/drivers/video/atyfb.c	Mon Dec  3 22:28:21 2001
@@ -45,7 +45,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/bwtwofb.c linux/drivers/video/bwtwofb.c
--- linux-2.4.2-pre2/drivers/video/bwtwofb.c	Mon Feb 14 15:31:14 2000
+++ linux/drivers/video/bwtwofb.c	Mon Dec  3 22:28:21 2001
@@ -15,7 +15,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/cgfourteenfb.c linux/drivers/video/cgfourteenfb.c
--- linux-2.4.2-pre2/drivers/video/cgfourteenfb.c	Tue Aug 29 14:09:15 2000
+++ linux/drivers/video/cgfourteenfb.c	Mon Dec  3 22:28:21 2001
@@ -12,7 +12,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/cgsixfb.c linux/drivers/video/cgsixfb.c
--- linux-2.4.2-pre2/drivers/video/cgsixfb.c	Wed Jul 26 18:36:44 2000
+++ linux/drivers/video/cgsixfb.c	Mon Dec  3 22:28:21 2001
@@ -13,7 +13,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/cgthreefb.c linux/drivers/video/cgthreefb.c
--- linux-2.4.2-pre2/drivers/video/cgthreefb.c	Tue Mar 21 23:38:25 2000
+++ linux/drivers/video/cgthreefb.c	Mon Dec  3 22:28:21 2001
@@ -13,7 +13,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/chipsfb.c linux/drivers/video/chipsfb.c
--- linux-2.4.2-pre2/drivers/video/chipsfb.c	Sun Sep 17 09:48:05 2000
+++ linux/drivers/video/chipsfb.c	Mon Dec  3 22:28:21 2001
@@ -21,7 +21,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/clgenfb.c linux/drivers/video/clgenfb.c
--- linux-2.4.2-pre2/drivers/video/clgenfb.c	Thu Jan  4 12:38:41 2001
+++ linux/drivers/video/clgenfb.c	Mon Dec  3 22:28:21 2001
@@ -40,7 +40,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/video/controlfb.c linux/drivers/video/controlfb.c
--- linux-2.4.2-pre2/drivers/video/controlfb.c	Mon Oct 16 12:37:52 2000
+++ linux/drivers/video/controlfb.c	Mon Dec  3 22:28:21 2001
@@ -31,7 +31,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/creatorfb.c linux/drivers/video/creatorfb.c
--- linux-2.4.2-pre2/drivers/video/creatorfb.c	Wed Jul 26 18:36:44 2000
+++ linux/drivers/video/creatorfb.c	Mon Dec  3 22:28:21 2001
@@ -11,7 +11,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/cyber2000fb.c linux/drivers/video/cyber2000fb.c
--- linux-2.4.2-pre2/drivers/video/cyber2000fb.c	Mon Sep 18 15:15:22 2000
+++ linux/drivers/video/cyber2000fb.c	Mon Dec  3 22:28:21 2001
@@ -31,7 +31,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/pci.h>
diff -urN linux-2.4.2-pre2/drivers/video/cyberfb.c linux/drivers/video/cyberfb.c
--- linux-2.4.2-pre2/drivers/video/cyberfb.c	Tue Nov  7 10:59:43 2000
+++ linux/drivers/video/cyberfb.c	Mon Dec  3 22:28:21 2001
@@ -82,7 +82,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/zorro.h>
 #include <linux/fb.h>
diff -urN linux-2.4.2-pre2/drivers/video/dn_cfb4.c linux/drivers/video/dn_cfb4.c
--- linux-2.4.2-pre2/drivers/video/dn_cfb4.c	Sun Aug  6 11:25:46 2000
+++ linux/drivers/video/dn_cfb4.c	Mon Dec  3 22:28:21 2001
@@ -3,7 +3,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <asm/setup.h>
diff -urN linux-2.4.2-pre2/drivers/video/dn_cfb8.c linux/drivers/video/dn_cfb8.c
--- linux-2.4.2-pre2/drivers/video/dn_cfb8.c	Sun Aug  6 11:25:46 2000
+++ linux/drivers/video/dn_cfb8.c	Mon Dec  3 22:28:21 2001
@@ -3,7 +3,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <asm/setup.h>
diff -urN linux-2.4.2-pre2/drivers/video/dnfb.c linux/drivers/video/dnfb.c
--- linux-2.4.2-pre2/drivers/video/dnfb.c	Mon Oct 16 12:37:52 2000
+++ linux/drivers/video/dnfb.c	Mon Dec  3 22:28:21 2001
@@ -3,7 +3,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <asm/setup.h>
diff -urN linux-2.4.2-pre2/drivers/video/fbcon.c linux/drivers/video/fbcon.c
--- linux-2.4.2-pre2/drivers/video/fbcon.c	Sat Oct 28 22:17:34 2000
+++ linux/drivers/video/fbcon.c	Mon Dec  3 22:28:21 2001
@@ -67,7 +67,7 @@
 #include <linux/console.h>
 #include <linux/string.h>
 #include <linux/kd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fb.h>
 #include <linux/vt_kern.h>
 #include <linux/selection.h>
diff -urN linux-2.4.2-pre2/drivers/video/fbmem.c linux/drivers/video/fbmem.c
--- linux-2.4.2-pre2/drivers/video/fbmem.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/video/fbmem.c	Mon Dec  3 22:28:21 2001
@@ -17,7 +17,7 @@
 #include <linux/smp_lock.h>
 #include <linux/kernel.h>
 #include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mman.h>
 #include <linux/tty.h>
 #include <linux/console.h>
diff -urN linux-2.4.2-pre2/drivers/video/g364fb.c linux/drivers/video/g364fb.c
--- linux-2.4.2-pre2/drivers/video/g364fb.c	Tue Nov  7 10:59:43 2000
+++ linux/drivers/video/g364fb.c	Mon Dec  3 22:28:21 2001
@@ -21,7 +21,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/hgafb.c linux/drivers/video/hgafb.c
--- linux-2.4.2-pre2/drivers/video/hgafb.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/video/hgafb.c	Mon Dec  3 22:28:21 2001
@@ -37,7 +37,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/video/hitfb.c linux/drivers/video/hitfb.c
--- linux-2.4.2-pre2/drivers/video/hitfb.c	Wed Aug  9 13:59:04 2000
+++ linux/drivers/video/hitfb.c	Mon Dec  3 22:28:21 2001
@@ -17,7 +17,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/nubus.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/video/hpfb.c linux/drivers/video/hpfb.c
--- linux-2.4.2-pre2/drivers/video/hpfb.c	Tue Nov  7 10:59:43 2000
+++ linux/drivers/video/hpfb.c	Mon Dec  3 22:28:21 2001
@@ -13,7 +13,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/fb.h>
diff -urN linux-2.4.2-pre2/drivers/video/igafb.c linux/drivers/video/igafb.c
--- linux-2.4.2-pre2/drivers/video/igafb.c	Wed Jul 26 11:08:41 2000
+++ linux/drivers/video/igafb.c	Mon Dec  3 22:28:21 2001
@@ -34,7 +34,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/imsttfb.c linux/drivers/video/imsttfb.c
--- linux-2.4.2-pre2/drivers/video/imsttfb.c	Fri Aug  4 18:06:34 2000
+++ linux/drivers/video/imsttfb.c	Mon Dec  3 22:28:21 2001
@@ -22,7 +22,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/leofb.c linux/drivers/video/leofb.c
--- linux-2.4.2-pre2/drivers/video/leofb.c	Wed Jul 26 18:36:44 2000
+++ linux/drivers/video/leofb.c	Mon Dec  3 22:28:21 2001
@@ -12,7 +12,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/macfb.c linux/drivers/video/macfb.c
--- linux-2.4.2-pre2/drivers/video/macfb.c	Mon Oct 16 12:37:52 2000
+++ linux/drivers/video/macfb.c	Mon Dec  3 22:28:21 2001
@@ -25,7 +25,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/nubus.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/video/matrox/matroxfb_base.h linux/drivers/video/matrox/matroxfb_base.h
--- linux-2.4.2-pre2/drivers/video/matrox/matroxfb_base.h	Mon Dec  3 22:28:12 2001
+++ linux/drivers/video/matrox/matroxfb_base.h	Mon Dec  3 22:28:21 2001
@@ -32,7 +32,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/console.h>
diff -urN linux-2.4.2-pre2/drivers/video/mdacon.c linux/drivers/video/mdacon.c
--- linux-2.4.2-pre2/drivers/video/mdacon.c	Mon Dec 11 13:47:20 2000
+++ linux/drivers/video/mdacon.c	Mon Dec  3 22:28:21 2001
@@ -33,7 +33,7 @@
 #include <linux/console_struct.h>
 #include <linux/string.h>
 #include <linux/kd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vt_kern.h>
 #include <linux/vt_buffer.h>
 #include <linux/selection.h>
diff -urN linux-2.4.2-pre2/drivers/video/offb.c linux/drivers/video/offb.c
--- linux-2.4.2-pre2/drivers/video/offb.c	Mon Oct 16 12:37:52 2000
+++ linux/drivers/video/offb.c	Mon Dec  3 22:28:21 2001
@@ -19,7 +19,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/p9100fb.c linux/drivers/video/p9100fb.c
--- linux-2.4.2-pre2/drivers/video/p9100fb.c	Mon Dec 20 22:06:42 1999
+++ linux/drivers/video/p9100fb.c	Mon Dec  3 22:28:21 2001
@@ -11,7 +11,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/platinumfb.c linux/drivers/video/platinumfb.c
--- linux-2.4.2-pre2/drivers/video/platinumfb.c	Sun Dec  3 17:45:24 2000
+++ linux/drivers/video/platinumfb.c	Mon Dec  3 22:28:21 2001
@@ -24,7 +24,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/pm2fb.c linux/drivers/video/pm2fb.c
--- linux-2.4.2-pre2/drivers/video/pm2fb.c	Mon Jul 24 18:24:26 2000
+++ linux/drivers/video/pm2fb.c	Mon Dec  3 22:28:21 2001
@@ -20,7 +20,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/promcon.c linux/drivers/video/promcon.c
--- linux-2.4.2-pre2/drivers/video/promcon.c	Mon Oct 16 12:53:18 2000
+++ linux/drivers/video/promcon.c	Mon Dec  3 22:28:21 2001
@@ -12,7 +12,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/console.h>
 #include <linux/console_struct.h>
diff -urN linux-2.4.2-pre2/drivers/video/q40fb.c linux/drivers/video/q40fb.c
--- linux-2.4.2-pre2/drivers/video/q40fb.c	Mon Oct 16 12:37:52 2000
+++ linux/drivers/video/q40fb.c	Mon Dec  3 22:28:21 2001
@@ -3,7 +3,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 
diff -urN linux-2.4.2-pre2/drivers/video/retz3fb.c linux/drivers/video/retz3fb.c
--- linux-2.4.2-pre2/drivers/video/retz3fb.c	Thu Jan  4 13:00:55 2001
+++ linux/drivers/video/retz3fb.c	Mon Dec  3 22:28:21 2001
@@ -26,7 +26,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/zorro.h>
diff -urN linux-2.4.2-pre2/drivers/video/riva/fbdev.c linux/drivers/video/riva/fbdev.c
--- linux-2.4.2-pre2/drivers/video/riva/fbdev.c	Mon Dec  3 22:28:12 2001
+++ linux/drivers/video/riva/fbdev.c	Mon Dec  3 22:28:21 2001
@@ -36,7 +36,7 @@
 #include <linux/mm.h>
 #include <linux/selection.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/video/sa1100fb.c linux/drivers/video/sa1100fb.c
--- linux-2.4.2-pre2/drivers/video/sa1100fb.c	Mon Sep 18 15:15:22 2000
+++ linux/drivers/video/sa1100fb.c	Mon Dec  3 22:28:21 2001
@@ -65,7 +65,7 @@
 #include <linux/ctype.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/fb.h>
 #include <linux/delay.h>
diff -urN linux-2.4.2-pre2/drivers/video/sbusfb.c linux/drivers/video/sbusfb.c
--- linux-2.4.2-pre2/drivers/video/sbusfb.c	Mon Jan 29 08:08:46 2001
+++ linux/drivers/video/sbusfb.c	Mon Dec  3 22:28:21 2001
@@ -28,7 +28,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/sgivwfb.c linux/drivers/video/sgivwfb.c
--- linux-2.4.2-pre2/drivers/video/sgivwfb.c	Sun Aug  6 11:25:46 2000
+++ linux/drivers/video/sgivwfb.c	Mon Dec  3 22:28:21 2001
@@ -16,7 +16,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/sis/sis_main.c linux/drivers/video/sis/sis_main.c
--- linux-2.4.2-pre2/drivers/video/sis/sis_main.c	Sun Nov 12 20:40:42 2000
+++ linux/drivers/video/sis/sis_main.c	Mon Dec  3 22:28:21 2001
@@ -18,7 +18,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/console.h>
diff -urN linux-2.4.2-pre2/drivers/video/skeletonfb.c linux/drivers/video/skeletonfb.c
--- linux-2.4.2-pre2/drivers/video/skeletonfb.c	Wed Jul 26 11:08:41 2000
+++ linux/drivers/video/skeletonfb.c	Mon Dec  3 22:28:21 2001
@@ -14,7 +14,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/video/sticon-bmode.c linux/drivers/video/sticon-bmode.c
--- linux-2.4.2-pre2/drivers/video/sticon-bmode.c	Wed Dec  6 11:46:39 2000
+++ linux/drivers/video/sticon-bmode.c	Mon Dec  3 22:28:21 2001
@@ -67,7 +67,7 @@
 #include <linux/console.h>
 #include <linux/string.h>
 #include <linux/kd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vt_kern.h>
 #include <linux/selection.h>
 #include <linux/ioport.h>
diff -urN linux-2.4.2-pre2/drivers/video/sticore.c linux/drivers/video/sticore.c
--- linux-2.4.2-pre2/drivers/video/sticore.c	Wed Dec  6 11:46:39 2000
+++ linux/drivers/video/sticore.c	Mon Dec  3 22:28:21 2001
@@ -1,7 +1,7 @@
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/drivers/video/stifb.c linux/drivers/video/stifb.c
--- linux-2.4.2-pre2/drivers/video/stifb.c	Tue Dec  5 12:29:39 2000
+++ linux/drivers/video/stifb.c	Mon Dec  3 22:28:21 2001
@@ -28,7 +28,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/drivers/video/sun3fb.c linux/drivers/video/sun3fb.c
--- linux-2.4.2-pre2/drivers/video/sun3fb.c	Thu Oct 12 11:18:36 2000
+++ linux/drivers/video/sun3fb.c	Mon Dec  3 22:28:21 2001
@@ -32,7 +32,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/tcxfb.c linux/drivers/video/tcxfb.c
--- linux-2.4.2-pre2/drivers/video/tcxfb.c	Mon Dec 20 22:06:42 1999
+++ linux/drivers/video/tcxfb.c	Mon Dec  3 22:28:21 2001
@@ -13,7 +13,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/tdfxfb.c linux/drivers/video/tdfxfb.c
--- linux-2.4.2-pre2/drivers/video/tdfxfb.c	Sun Dec  3 17:45:24 2000
+++ linux/drivers/video/tdfxfb.c	Mon Dec  3 22:28:21 2001
@@ -61,7 +61,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/tgafb.c linux/drivers/video/tgafb.c
--- linux-2.4.2-pre2/drivers/video/tgafb.c	Tue Nov  7 10:59:43 2000
+++ linux/drivers/video/tgafb.c	Mon Dec  3 22:28:21 2001
@@ -34,7 +34,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/valkyriefb.c linux/drivers/video/valkyriefb.c
--- linux-2.4.2-pre2/drivers/video/valkyriefb.c	Sun Sep 17 09:48:05 2000
+++ linux/drivers/video/valkyriefb.c	Mon Dec  3 22:28:21 2001
@@ -44,7 +44,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/vesafb.c linux/drivers/video/vesafb.c
--- linux-2.4.2-pre2/drivers/video/vesafb.c	Mon Oct 16 12:37:52 2000
+++ linux/drivers/video/vesafb.c	Mon Dec  3 22:28:21 2001
@@ -14,7 +14,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/console.h>
diff -urN linux-2.4.2-pre2/drivers/video/vfb.c linux/drivers/video/vfb.c
--- linux-2.4.2-pre2/drivers/video/vfb.c	Wed Jan 17 13:27:16 2001
+++ linux/drivers/video/vfb.c	Mon Dec  3 22:28:21 2001
@@ -14,7 +14,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
diff -urN linux-2.4.2-pre2/drivers/video/vga16fb.c linux/drivers/video/vga16fb.c
--- linux-2.4.2-pre2/drivers/video/vga16fb.c	Wed Jul 26 11:08:41 2000
+++ linux/drivers/video/vga16fb.c	Mon Dec  3 22:28:21 2001
@@ -15,7 +15,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/console.h>
diff -urN linux-2.4.2-pre2/drivers/video/vgacon.c linux/drivers/video/vgacon.c
--- linux-2.4.2-pre2/drivers/video/vgacon.c	Tue Nov 28 22:34:31 2000
+++ linux/drivers/video/vgacon.c	Mon Dec  3 22:28:21 2001
@@ -43,7 +43,7 @@
 #include <linux/console_struct.h>
 #include <linux/string.h>
 #include <linux/kd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vt_kern.h>
 #include <linux/selection.h>
 #include <linux/spinlock.h>
diff -urN linux-2.4.2-pre2/drivers/video/virgefb.c linux/drivers/video/virgefb.c
--- linux-2.4.2-pre2/drivers/video/virgefb.c	Tue Nov  7 10:59:43 2000
+++ linux/drivers/video/virgefb.c	Mon Dec  3 22:28:21 2001
@@ -22,7 +22,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/tty.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/zorro.h>
 #include <linux/fb.h>
diff -urN linux-2.4.2-pre2/fs/adfs/super.c linux/fs/adfs/super.c
--- linux-2.4.2-pre2/fs/adfs/super.c	Mon Sep 18 15:14:06 2000
+++ linux/fs/adfs/super.c	Mon Dec  3 22:28:21 2001
@@ -12,7 +12,7 @@
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/adfs_fs.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/stat.h>
 #include <linux/string.h>
diff -urN linux-2.4.2-pre2/fs/affs/file.c linux/fs/affs/file.c
--- linux-2.4.2-pre2/fs/affs/file.c	Fri Dec 29 14:07:57 2000
+++ linux/fs/affs/file.c	Mon Dec  3 22:28:21 2001
@@ -21,7 +21,7 @@
 #include <linux/fcntl.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/stat.h>
 #include <linux/locks.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.4.2-pre2/fs/affs/inode.c linux/fs/affs/inode.c
--- linux-2.4.2-pre2/fs/affs/inode.c	Thu Nov 16 13:18:26 2000
+++ linux/fs/affs/inode.c	Mon Dec  3 22:28:21 2001
@@ -14,7 +14,7 @@
 #include <asm/div64.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/stat.h>
 #include <linux/sched.h>
 #include <linux/affs_fs.h>
diff -urN linux-2.4.2-pre2/fs/affs/super.c linux/fs/affs/super.c
--- linux-2.4.2-pre2/fs/affs/super.c	Tue Sep  5 14:07:29 2000
+++ linux/fs/affs/super.c	Mon Dec  3 22:28:21 2001
@@ -14,7 +14,7 @@
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/stat.h>
 #include <linux/sched.h>
 #include <linux/affs_fs.h>
diff -urN linux-2.4.2-pre2/fs/autofs/autofs_i.h linux/fs/autofs/autofs_i.h
--- linux-2.4.2-pre2/fs/autofs/autofs_i.h	Mon Dec 11 13:27:15 2000
+++ linux/fs/autofs/autofs_i.h	Mon Dec  3 22:28:21 2001
@@ -19,7 +19,7 @@
 #define AUTOFS_IOC_COUNT     32
 
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/wait.h>
diff -urN linux-2.4.2-pre2/fs/autofs/inode.c linux/fs/autofs/inode.c
--- linux-2.4.2-pre2/fs/autofs/inode.c	Fri Nov 17 11:35:27 2000
+++ linux/fs/autofs/inode.c	Mon Dec  3 22:28:21 2001
@@ -11,7 +11,7 @@
  * ------------------------------------------------------------------------- */
 
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/file.h>
 #include <linux/locks.h>
 #include <asm/bitops.h>
diff -urN linux-2.4.2-pre2/fs/autofs/waitq.c linux/fs/autofs/waitq.c
--- linux-2.4.2-pre2/fs/autofs/waitq.c	Fri Sep  1 14:35:04 2000
+++ linux/fs/autofs/waitq.c	Mon Dec  3 22:28:21 2001
@@ -10,7 +10,7 @@
  *
  * ------------------------------------------------------------------------- */
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
 #include <linux/file.h>
diff -urN linux-2.4.2-pre2/fs/autofs4/autofs_i.h linux/fs/autofs4/autofs_i.h
--- linux-2.4.2-pre2/fs/autofs4/autofs_i.h	Mon Jan 29 23:25:02 2001
+++ linux/fs/autofs4/autofs_i.h	Mon Dec  3 22:28:21 2001
@@ -20,7 +20,7 @@
 #define AUTOFS_IOC_COUNT     32
 
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/wait.h>
diff -urN linux-2.4.2-pre2/fs/autofs4/inode.c linux/fs/autofs4/inode.c
--- linux-2.4.2-pre2/fs/autofs4/inode.c	Thu Nov 16 13:18:26 2000
+++ linux/fs/autofs4/inode.c	Mon Dec  3 22:28:21 2001
@@ -11,7 +11,7 @@
  * ------------------------------------------------------------------------- */
 
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/file.h>
 #include <linux/locks.h>
 #include <asm/bitops.h>
diff -urN linux-2.4.2-pre2/fs/autofs4/waitq.c linux/fs/autofs4/waitq.c
--- linux-2.4.2-pre2/fs/autofs4/waitq.c	Fri Sep  1 14:35:16 2000
+++ linux/fs/autofs4/waitq.c	Mon Dec  3 22:28:21 2001
@@ -10,7 +10,7 @@
  *
  * ------------------------------------------------------------------------- */
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/signal.h>
 #include <linux/file.h>
diff -urN linux-2.4.2-pre2/fs/binfmt_aout.c linux/fs/binfmt_aout.c
--- linux-2.4.2-pre2/fs/binfmt_aout.c	Fri Jul  7 15:54:01 2000
+++ linux/fs/binfmt_aout.c	Mon Dec  3 22:28:21 2001
@@ -20,7 +20,7 @@
 #include <linux/fcntl.h>
 #include <linux/ptrace.h>
 #include <linux/user.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/binfmts.h>
 #include <linux/personality.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/fs/binfmt_elf.c linux/fs/binfmt_elf.c
--- linux-2.4.2-pre2/fs/binfmt_elf.c	Tue Nov 28 21:53:45 2000
+++ linux/fs/binfmt_elf.c	Mon Dec  3 22:28:21 2001
@@ -24,7 +24,7 @@
 #include <linux/file.h>
 #include <linux/fcntl.h>
 #include <linux/ptrace.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/shm.h>
 #include <linux/personality.h>
 #include <linux/elfcore.h>
diff -urN linux-2.4.2-pre2/fs/binfmt_em86.c linux/fs/binfmt_em86.c
--- linux-2.4.2-pre2/fs/binfmt_em86.c	Mon Jun 26 11:36:44 2000
+++ linux/fs/binfmt_em86.c	Mon Dec  3 22:28:21 2001
@@ -11,7 +11,7 @@
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/stat.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/locks.h>
 #include <linux/smp_lock.h>
 #include <linux/binfmts.h>
diff -urN linux-2.4.2-pre2/fs/binfmt_misc.c linux/fs/binfmt_misc.c
--- linux-2.4.2-pre2/fs/binfmt_misc.c	Mon Jul 31 10:51:09 2000
+++ linux/fs/binfmt_misc.c	Mon Dec  3 22:28:21 2001
@@ -21,7 +21,7 @@
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/binfmts.h>
 #include <linux/init.h>
 #include <linux/proc_fs.h>
diff -urN linux-2.4.2-pre2/fs/binfmt_script.c linux/fs/binfmt_script.c
--- linux-2.4.2-pre2/fs/binfmt_script.c	Mon Jul 31 10:51:09 2000
+++ linux/fs/binfmt_script.c	Mon Dec  3 22:28:21 2001
@@ -8,7 +8,7 @@
 #include <linux/module.h>
 #include <linux/string.h>
 #include <linux/stat.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/binfmts.h>
 #include <linux/init.h>
 #include <linux/file.h>
diff -urN linux-2.4.2-pre2/fs/block_dev.c linux/fs/block_dev.c
--- linux-2.4.2-pre2/fs/block_dev.c	Fri Dec  8 17:36:41 2000
+++ linux/fs/block_dev.c	Mon Dec  3 22:28:21 2001
@@ -9,8 +9,9 @@
 #include <linux/mm.h>
 #include <linux/locks.h>
 #include <linux/fcntl.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/kmod.h>
+#include <linux/major.h>
 #include <linux/devfs_fs_kernel.h>
 #include <linux/smp_lock.h>
 
diff -urN linux-2.4.2-pre2/fs/buffer.c linux/fs/buffer.c
--- linux-2.4.2-pre2/fs/buffer.c	Mon Jan 15 12:42:32 2001
+++ linux/fs/buffer.c	Mon Dec  3 22:28:21 2001
@@ -31,7 +31,7 @@
 #include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/locks.h>
 #include <linux/errno.h>
 #include <linux/swap.h>
diff -urN linux-2.4.2-pre2/fs/coda/cnode.c linux/fs/coda/cnode.c
--- linux-2.4.2-pre2/fs/coda/cnode.c	Sun Jan 28 13:29:10 2001
+++ linux/fs/coda/cnode.c	Mon Dec  3 22:28:21 2001
@@ -194,8 +194,13 @@
 		return NULL;
 	}
 
-	/* check if this inode is linked to a cnode */
 	cii = ITOC(inode);
+
+	/* The inode might already be purged due to memory pressure */
+	if ( coda_fideq(&cii->c_fid, &NullFID) ) {
+		iput(inode);
+		return NULL;
+	}
 
 	/* we shouldn't have inode collisions anymore */
 	if ( !coda_fideq(fid, &cii->c_fid) ) BUG();
diff -urN linux-2.4.2-pre2/fs/coda/psdev.c linux/fs/coda/psdev.c
--- linux-2.4.2-pre2/fs/coda/psdev.c	Mon Oct 16 12:58:51 2000
+++ linux/fs/coda/psdev.c	Mon Dec  3 22:28:21 2001
@@ -23,7 +23,7 @@
 #include <linux/major.h>
 #include <linux/sched.h>
 #include <linux/lp.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/fcntl.h>
 #include <linux/delay.h>
diff -urN linux-2.4.2-pre2/fs/coda/sysctl.c linux/fs/coda/sysctl.c
--- linux-2.4.2-pre2/fs/coda/sysctl.c	Tue Sep 19 15:08:59 2000
+++ linux/fs/coda/sysctl.c	Mon Dec  3 22:28:21 2001
@@ -17,7 +17,7 @@
 #include <linux/sysctl.h>
 #include <linux/swapctl.h>
 #include <linux/proc_fs.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/stat.h>
 #include <linux/ctype.h>
 #include <asm/bitops.h>
diff -urN linux-2.4.2-pre2/fs/coda/upcall.c linux/fs/coda/upcall.c
--- linux-2.4.2-pre2/fs/coda/upcall.c	Tue Sep 19 15:08:59 2000
+++ linux/fs/coda/upcall.c	Mon Dec  3 22:28:21 2001
@@ -519,7 +519,7 @@
 
         /* build packet for Venus */
         if (data->vi.in_size > VC_MAXDATASIZE) {
-	        error = EINVAL;
+	        error = -EINVAL;
 		goto exit;
         }
 
@@ -539,7 +539,7 @@
         /* get the data out of user space */
         if ( copy_from_user((char*)inp + (long)inp->coda_ioctl.data,
 			    data->vi.in, data->vi.in_size) ) {
-	        error = EINVAL;
+	        error = -EINVAL;
 	        goto exit;
 	}
 
@@ -557,7 +557,7 @@
                 CDEBUG(D_FILE, "return len %d <= request len %d\n",
                       outp->coda_ioctl.len, 
                       data->vi.out_size);
-                error = EINVAL;
+                error = -EINVAL;
         } else {
 		error = verify_area(VERIFY_WRITE, data->vi.out, 
                                     data->vi.out_size);
@@ -566,7 +566,7 @@
 		if (copy_to_user(data->vi.out, 
 				 (char *)outp + (long)outp->coda_ioctl.data, 
 				 data->vi.out_size)) {
-		        error = EINVAL;
+		        error = -EINVAL;
 			goto exit;
 		}
         }
diff -urN linux-2.4.2-pre2/fs/dcache.c linux/fs/dcache.c
--- linux-2.4.2-pre2/fs/dcache.c	Mon Dec  3 22:28:12 2001
+++ linux/fs/dcache.c	Mon Dec  3 22:28:21 2001
@@ -18,7 +18,7 @@
 #include <linux/string.h>
 #include <linux/mm.h>
 #include <linux/fs.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/smp_lock.h>
@@ -341,8 +341,7 @@
 		if (dentry->d_flags & DCACHE_REFERENCED) {
 			dentry->d_flags &= ~DCACHE_REFERENCED;
 			list_add(&dentry->d_lru, &dentry_unused);
-			count--;
-			continue;
+			goto next;
 		}
 		dentry_stat.nr_unused--;
 
@@ -351,6 +350,7 @@
 			BUG();
 
 		prune_one_dentry(dentry);
+	next:
 		if (!--count)
 			break;
 	}
@@ -691,7 +691,7 @@
 static inline struct list_head * d_hash(struct dentry * parent, unsigned long hash)
 {
 	hash += (unsigned long) parent / L1_CACHE_BYTES;
-	hash = hash ^ (hash >> D_HASHBITS) ^ (hash >> D_HASHBITS*2);
+	hash = hash ^ (hash >> D_HASHBITS);
 	return dentry_hashtable + (hash & D_HASHMASK);
 }
 
diff -urN linux-2.4.2-pre2/fs/devfs/base.c linux/fs/devfs/base.c
--- linux-2.4.2-pre2/fs/devfs/base.c	Fri Nov 17 11:36:27 2000
+++ linux/fs/devfs/base.c	Mon Dec  3 22:28:21 2001
@@ -491,7 +491,7 @@
 #include <linux/kernel.h>
 #include <linux/wait.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
 #include <linux/ctype.h>
diff -urN linux-2.4.2-pre2/fs/devpts/inode.c linux/fs/devpts/inode.c
--- linux-2.4.2-pre2/fs/devpts/inode.c	Thu Nov 16 13:18:26 2000
+++ linux/fs/devpts/inode.c	Mon Dec  3 22:28:21 2001
@@ -19,7 +19,7 @@
 #include <linux/kernel.h>
 #include <linux/locks.h>
 #include <linux/major.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/stat.h>
 #include <linux/tty.h>
 #include <asm/bitops.h>
diff -urN linux-2.4.2-pre2/fs/dquot.c linux/fs/dquot.c
--- linux-2.4.2-pre2/fs/dquot.c	Tue Nov 28 22:40:50 2000
+++ linux/fs/dquot.c	Mon Dec  3 22:28:21 2001
@@ -47,7 +47,7 @@
 #include <linux/stat.h>
 #include <linux/tty.h>
 #include <linux/file.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mount.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.4.2-pre2/fs/fat/buffer.c linux/fs/fat/buffer.c
--- linux-2.4.2-pre2/fs/fat/buffer.c	Tue Sep  5 14:07:29 2000
+++ linux/fs/fat/buffer.c	Mon Dec  3 22:28:21 2001
@@ -5,7 +5,7 @@
  */
 
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/fs.h>
 #include <linux/msdos_fs.h>
diff -urN linux-2.4.2-pre2/fs/fat/inode.c linux/fs/fat/inode.c
--- linux-2.4.2-pre2/fs/fat/inode.c	Sun Dec 31 11:02:21 2000
+++ linux/fs/fat/inode.c	Mon Dec  3 22:28:21 2001
@@ -27,7 +27,7 @@
 #include <linux/stat.h>
 #include <linux/locks.h>
 #include <linux/fat_cvf.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/smp_lock.h>
 
 #include "msbuffer.h"
diff -urN linux-2.4.2-pre2/fs/fifo.c linux/fs/fifo.c
--- linux-2.4.2-pre2/fs/fifo.c	Sat Jul  8 19:26:13 2000
+++ linux/fs/fifo.c	Mon Dec  3 22:28:21 2001
@@ -10,7 +10,7 @@
  */
 
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/smp_lock.h>
 
 static void wait_for_partner(struct inode* inode, unsigned int* cnt)
diff -urN linux-2.4.2-pre2/fs/file.c linux/fs/file.c
--- linux-2.4.2-pre2/fs/file.c	Tue Nov 28 22:43:39 2000
+++ linux/fs/file.c	Mon Dec  3 22:28:21 2001
@@ -9,7 +9,7 @@
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 
 #include <asm/bitops.h>
diff -urN linux-2.4.2-pre2/fs/hpfs/hpfs_fn.h linux/fs/hpfs/hpfs_fn.h
--- linux-2.4.2-pre2/fs/hpfs/hpfs_fn.h	Mon Dec 11 13:26:31 2000
+++ linux/fs/hpfs/hpfs_fn.h	Mon Dec  3 22:28:21 2001
@@ -12,7 +12,7 @@
 #include <linux/fs.h>
 #include <linux/hpfs_fs.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/locks.h>
diff -urN linux-2.4.2-pre2/fs/inode.c linux/fs/inode.c
--- linux-2.4.2-pre2/fs/inode.c	Mon Dec  3 22:28:12 2001
+++ linux/fs/inode.c	Mon Dec  3 22:28:21 2001
@@ -725,7 +725,7 @@
 static inline unsigned long hash(struct super_block *sb, unsigned long i_ino)
 {
 	unsigned long tmp = i_ino + ((unsigned long) sb / L1_CACHE_BYTES);
-	tmp = tmp + (tmp >> I_HASHBITS) + (tmp >> I_HASHBITS*2);
+	tmp = tmp + (tmp >> I_HASHBITS);
 	return tmp & I_HASHMASK;
 }
 
diff -urN linux-2.4.2-pre2/fs/iobuf.c linux/fs/iobuf.c
--- linux-2.4.2-pre2/fs/iobuf.c	Thu Mar  9 21:12:27 2000
+++ linux/fs/iobuf.c	Mon Dec  3 22:28:21 2001
@@ -7,7 +7,7 @@
  */
 
 #include <linux/iobuf.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/slab.h>
 
 static kmem_cache_t *kiobuf_cachep;
diff -urN linux-2.4.2-pre2/fs/ioctl.c linux/fs/ioctl.c
--- linux-2.4.2-pre2/fs/ioctl.c	Sat Aug 12 19:48:04 2000
+++ linux/fs/ioctl.c	Mon Dec  3 22:28:21 2001
@@ -9,6 +9,7 @@
 #include <linux/file.h>
 
 #include <asm/uaccess.h>
+#include <asm/ioctls.h>
 
 static int file_ioctl(struct file *filp,unsigned int cmd,unsigned long arg)
 {
diff -urN linux-2.4.2-pre2/fs/isofs/dir.c linux/fs/isofs/dir.c
--- linux-2.4.2-pre2/fs/isofs/dir.c	Wed Nov 29 10:11:38 2000
+++ linux/fs/isofs/dir.c	Mon Dec  3 22:28:21 2001
@@ -17,7 +17,7 @@
 #include <linux/stat.h>
 #include <linux/string.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/locks.h>
 #include <linux/config.h>
diff -urN linux-2.4.2-pre2/fs/isofs/inode.c linux/fs/isofs/inode.c
--- linux-2.4.2-pre2/fs/isofs/inode.c	Mon Jan  1 10:23:21 2001
+++ linux/fs/isofs/inode.c	Mon Dec  3 22:28:21 2001
@@ -20,7 +20,7 @@
 #include <linux/mm.h>
 #include <linux/string.h>
 #include <linux/locks.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/cdrom.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/fs/isofs/joliet.c linux/fs/isofs/joliet.c
--- linux-2.4.2-pre2/fs/isofs/joliet.c	Fri Nov 17 15:29:55 2000
+++ linux/fs/isofs/joliet.c	Mon Dec  3 22:28:21 2001
@@ -8,7 +8,7 @@
 
 #include <linux/string.h>
 #include <linux/nls.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/iso_fs.h>
 
 /*
diff -urN linux-2.4.2-pre2/fs/isofs/namei.c linux/fs/isofs/namei.c
--- linux-2.4.2-pre2/fs/isofs/namei.c	Wed Nov 29 10:11:38 2000
+++ linux/fs/isofs/namei.c	Mon Dec  3 22:28:21 2001
@@ -12,7 +12,7 @@
 #include <linux/string.h>
 #include <linux/stat.h>
 #include <linux/fcntl.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/config.h>	/* Joliet? */
 
diff -urN linux-2.4.2-pre2/fs/isofs/rock.c linux/fs/isofs/rock.c
--- linux-2.4.2-pre2/fs/isofs/rock.c	Fri Dec 29 14:07:57 2000
+++ linux/fs/isofs/rock.c	Mon Dec  3 22:28:21 2001
@@ -11,7 +11,7 @@
 #include <linux/iso_fs.h>
 #include <linux/string.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pagemap.h>
 #include <linux/smp_lock.h>
 
diff -urN linux-2.4.2-pre2/fs/jffs/inode-v23.c linux/fs/jffs/inode-v23.c
--- linux-2.4.2-pre2/fs/jffs/inode-v23.c	Fri Dec 29 14:07:57 2000
+++ linux/fs/jffs/inode-v23.c	Mon Dec  3 22:28:21 2001
@@ -39,7 +39,7 @@
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/jffs.h>
 #include <linux/fs.h>
 #include <linux/locks.h>
diff -urN linux-2.4.2-pre2/fs/jffs/intrep.c linux/fs/jffs/intrep.c
--- linux-2.4.2-pre2/fs/jffs/intrep.c	Fri Nov 17 16:44:55 2000
+++ linux/fs/jffs/intrep.c	Mon Dec  3 22:28:21 2001
@@ -58,7 +58,7 @@
 
 #define __NO_VERSION__
 #include <linux/types.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/jffs.h>
 #include <linux/fs.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/fs/jffs/jffs_fm.c linux/fs/jffs/jffs_fm.c
--- linux-2.4.2-pre2/fs/jffs/jffs_fm.c	Fri Sep  8 12:44:55 2000
+++ linux/fs/jffs/jffs_fm.c	Mon Dec  3 22:28:21 2001
@@ -17,7 +17,7 @@
  *
  */
 #define __NO_VERSION__
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/blkdev.h>
 #include <linux/jffs.h>
 #include "jffs_fm.h"
diff -urN linux-2.4.2-pre2/fs/lockd/host.c linux/fs/lockd/host.c
--- linux-2.4.2-pre2/fs/lockd/host.c	Sun Oct  1 20:35:16 2000
+++ linux/fs/lockd/host.c	Mon Dec  3 22:28:21 2001
@@ -10,7 +10,7 @@
 
 #include <linux/types.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/in.h>
 #include <linux/sunrpc/clnt.h>
 #include <linux/sunrpc/svc.h>
diff -urN linux-2.4.2-pre2/fs/lockd/svc.c linux/fs/lockd/svc.c
--- linux-2.4.2-pre2/fs/lockd/svc.c	Fri Dec 29 14:07:23 2000
+++ linux/fs/lockd/svc.c	Mon Dec  3 22:28:21 2001
@@ -22,7 +22,7 @@
 #include <linux/uio.h>
 #include <linux/version.h>
 #include <linux/unistd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 
diff -urN linux-2.4.2-pre2/fs/lockd/svc4proc.c linux/fs/lockd/svc4proc.c
--- linux-2.4.2-pre2/fs/lockd/svc4proc.c	Mon Apr  3 13:24:05 2000
+++ linux/fs/lockd/svc4proc.c	Mon Dec  3 22:28:21 2001
@@ -9,7 +9,7 @@
 
 #include <linux/types.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/in.h>
 #include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/clnt.h>
diff -urN linux-2.4.2-pre2/fs/lockd/svcproc.c linux/fs/lockd/svcproc.c
--- linux-2.4.2-pre2/fs/lockd/svcproc.c	Mon Apr  3 13:24:06 2000
+++ linux/fs/lockd/svcproc.c	Mon Dec  3 22:28:21 2001
@@ -10,7 +10,7 @@
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/in.h>
 #include <linux/sunrpc/svc.h>
 #include <linux/sunrpc/clnt.h>
diff -urN linux-2.4.2-pre2/fs/lockd/svcshare.c linux/fs/lockd/svcshare.c
--- linux-2.4.2-pre2/fs/lockd/svcshare.c	Thu Sep 21 13:38:58 2000
+++ linux/fs/lockd/svcshare.c	Mon Dec  3 22:28:21 2001
@@ -9,7 +9,7 @@
 #include <linux/sched.h>
 #include <linux/unistd.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <linux/sunrpc/clnt.h>
 #include <linux/sunrpc/svc.h>
diff -urN linux-2.4.2-pre2/fs/locks.c linux/fs/locks.c
--- linux-2.4.2-pre2/fs/locks.c	Sun Dec  3 10:24:07 2000
+++ linux/fs/locks.c	Mon Dec  3 22:28:21 2001
@@ -115,7 +115,7 @@
  *  Stephen Rothwell <sfr@linuxcare.com>, June, 2000.
  */
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/file.h>
 #include <linux/smp_lock.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/fs/minix/inode.c linux/fs/minix/inode.c
--- linux-2.4.2-pre2/fs/minix/inode.c	Mon Dec  4 18:59:30 2000
+++ linux/fs/minix/inode.c	Mon Dec  3 22:28:21 2001
@@ -14,7 +14,7 @@
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/stat.h>
 #include <linux/locks.h>
diff -urN linux-2.4.2-pre2/fs/ncpfs/dir.c linux/fs/ncpfs/dir.c
--- linux-2.4.2-pre2/fs/ncpfs/dir.c	Sat Jan 20 08:51:51 2001
+++ linux/fs/ncpfs/dir.c	Mon Dec  3 22:28:21 2001
@@ -15,7 +15,7 @@
 #include <linux/errno.h>
 #include <linux/stat.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/mm.h>
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/fs/ncpfs/file.c linux/fs/ncpfs/file.c
--- linux-2.4.2-pre2/fs/ncpfs/file.c	Fri Nov 17 11:36:27 2000
+++ linux/fs/ncpfs/file.c	Mon Dec  3 22:28:21 2001
@@ -16,7 +16,7 @@
 #include <linux/stat.h>
 #include <linux/mm.h>
 #include <linux/locks.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 
 #include <linux/ncp_fs.h>
diff -urN linux-2.4.2-pre2/fs/ncpfs/inode.c linux/fs/ncpfs/inode.c
--- linux-2.4.2-pre2/fs/ncpfs/inode.c	Thu Nov 16 13:18:26 2000
+++ linux/fs/ncpfs/inode.c	Mon Dec  3 22:28:21 2001
@@ -24,7 +24,7 @@
 #include <linux/locks.h>
 #include <linux/file.h>
 #include <linux/fcntl.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/init.h>
 
diff -urN linux-2.4.2-pre2/fs/ncpfs/mmap.c linux/fs/ncpfs/mmap.c
--- linux-2.4.2-pre2/fs/ncpfs/mmap.c	Sat Nov 11 18:50:28 2000
+++ linux/fs/ncpfs/mmap.c	Mon Dec  3 22:28:21 2001
@@ -14,7 +14,7 @@
 #include <linux/errno.h>
 #include <linux/mman.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fcntl.h>
 #include <linux/ncp_fs.h>
 
diff -urN linux-2.4.2-pre2/fs/ncpfs/ncplib_kernel.h linux/fs/ncpfs/ncplib_kernel.h
--- linux-2.4.2-pre2/fs/ncpfs/ncplib_kernel.h	Mon Dec 11 13:26:24 2000
+++ linux/fs/ncpfs/ncplib_kernel.h	Mon Dec  3 22:28:21 2001
@@ -17,7 +17,7 @@
 #include <linux/fs.h>
 #include <linux/types.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/stat.h>
 #include <linux/fcntl.h>
 #include <linux/pagemap.h>
diff -urN linux-2.4.2-pre2/fs/nfs/dir.c linux/fs/nfs/dir.c
--- linux-2.4.2-pre2/fs/nfs/dir.c	Sun Dec 10 09:55:48 2000
+++ linux/fs/nfs/dir.c	Mon Dec  3 22:28:21 2001
@@ -23,7 +23,7 @@
 #include <linux/fcntl.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/sunrpc/clnt.h>
 #include <linux/nfs_fs.h>
diff -urN linux-2.4.2-pre2/fs/nfs/file.c linux/fs/nfs/file.c
--- linux-2.4.2-pre2/fs/nfs/file.c	Fri Dec 29 14:07:57 2000
+++ linux/fs/nfs/file.c	Mon Dec  3 22:28:21 2001
@@ -24,7 +24,7 @@
 #include <linux/nfs_fs.h>
 #include <linux/nfs_mount.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pagemap.h>
 #include <linux/lockd/bind.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.4.2-pre2/fs/nfs/flushd.c linux/fs/nfs/flushd.c
--- linux-2.4.2-pre2/fs/nfs/flushd.c	Tue Jan 23 15:22:24 2001
+++ linux/fs/nfs/flushd.c	Mon Dec  3 22:28:21 2001
@@ -24,7 +24,7 @@
 
 #include <linux/config.h>
 #include <linux/types.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pagemap.h>
 #include <linux/file.h>
 
diff -urN linux-2.4.2-pre2/fs/nfs/nfs2xdr.c linux/fs/nfs/nfs2xdr.c
--- linux-2.4.2-pre2/fs/nfs/nfs2xdr.c	Mon Oct 16 13:36:08 2000
+++ linux/fs/nfs/nfs2xdr.c	Mon Dec  3 22:28:21 2001
@@ -12,7 +12,7 @@
 #include <linux/param.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/utsname.h>
 #include <linux/errno.h>
 #include <linux/string.h>
diff -urN linux-2.4.2-pre2/fs/nfs/nfs3xdr.c linux/fs/nfs/nfs3xdr.c
--- linux-2.4.2-pre2/fs/nfs/nfs3xdr.c	Mon Oct 16 13:36:08 2000
+++ linux/fs/nfs/nfs3xdr.c	Mon Dec  3 22:28:21 2001
@@ -9,7 +9,7 @@
 #include <linux/param.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/utsname.h>
 #include <linux/errno.h>
 #include <linux/string.h>
diff -urN linux-2.4.2-pre2/fs/nfs/proc.c linux/fs/nfs/proc.c
--- linux-2.4.2-pre2/fs/nfs/proc.c	Sun Dec  3 18:01:01 2000
+++ linux/fs/nfs/proc.c	Mon Dec  3 22:28:21 2001
@@ -29,7 +29,7 @@
 
 #include <linux/types.h>
 #include <linux/param.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/utsname.h>
diff -urN linux-2.4.2-pre2/fs/nfs/read.c linux/fs/nfs/read.c
--- linux-2.4.2-pre2/fs/nfs/read.c	Fri Dec 29 14:07:57 2000
+++ linux/fs/nfs/read.c	Mon Dec  3 22:28:21 2001
@@ -22,7 +22,7 @@
 #include <linux/fcntl.h>
 #include <linux/stat.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pagemap.h>
 #include <linux/sunrpc/clnt.h>
 #include <linux/nfs_fs.h>
diff -urN linux-2.4.2-pre2/fs/nfs/symlink.c linux/fs/nfs/symlink.c
--- linux-2.4.2-pre2/fs/nfs/symlink.c	Sun Dec  3 18:01:01 2000
+++ linux/fs/nfs/symlink.c	Mon Dec  3 22:28:21 2001
@@ -20,7 +20,7 @@
 #include <linux/pagemap.h>
 #include <linux/stat.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/smp_lock.h>
 
diff -urN linux-2.4.2-pre2/fs/nfs/unlink.c linux/fs/nfs/unlink.c
--- linux-2.4.2-pre2/fs/nfs/unlink.c	Sun Oct  1 20:35:16 2000
+++ linux/fs/nfs/unlink.c	Mon Dec  3 22:28:21 2001
@@ -6,7 +6,7 @@
  * NOTE: we rely on holding the BKL for list manipulation protection.
  */
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/dcache.h>
 #include <linux/sunrpc/sched.h>
diff -urN linux-2.4.2-pre2/fs/nfs/write.c linux/fs/nfs/write.c
--- linux-2.4.2-pre2/fs/nfs/write.c	Fri Dec 29 14:07:57 2000
+++ linux/fs/nfs/write.c	Mon Dec  3 22:28:21 2001
@@ -48,7 +48,7 @@
 
 #include <linux/config.h>
 #include <linux/types.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/swap.h>
 #include <linux/pagemap.h>
 #include <linux/file.h>
diff -urN linux-2.4.2-pre2/fs/nfsd/export.c linux/fs/nfsd/export.c
--- linux-2.4.2-pre2/fs/nfsd/export.c	Sun Oct  1 20:35:16 2000
+++ linux/fs/nfsd/export.c	Mon Dec  3 22:28:21 2001
@@ -15,7 +15,7 @@
  */
 
 #include <linux/unistd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/stat.h>
 #include <linux/in.h>
 
diff -urN linux-2.4.2-pre2/fs/nfsd/nfs3proc.c linux/fs/nfsd/nfs3proc.c
--- linux-2.4.2-pre2/fs/nfsd/nfs3proc.c	Wed Sep 27 13:41:33 2000
+++ linux/fs/nfsd/nfs3proc.c	Mon Dec  3 22:28:21 2001
@@ -18,7 +18,7 @@
 #include <linux/in.h>
 #include <linux/version.h>
 #include <linux/unistd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/major.h>
 
 #include <linux/sunrpc/svc.h>
diff -urN linux-2.4.2-pre2/fs/nfsd/nfscache.c linux/fs/nfsd/nfscache.c
--- linux-2.4.2-pre2/fs/nfsd/nfscache.c	Mon Oct 16 12:58:51 2000
+++ linux/fs/nfsd/nfscache.c	Mon Dec  3 22:28:21 2001
@@ -12,7 +12,7 @@
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 
 #include <linux/sunrpc/svc.h>
diff -urN linux-2.4.2-pre2/fs/nfsd/nfsctl.c linux/fs/nfsd/nfsctl.c
--- linux-2.4.2-pre2/fs/nfsd/nfsctl.c	Sun Oct  1 20:35:16 2000
+++ linux/fs/nfsd/nfsctl.c	Mon Dec  3 22:28:21 2001
@@ -18,7 +18,7 @@
 #include <linux/net.h>
 #include <linux/in.h>
 #include <linux/unistd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/proc_fs.h>
 
 #include <linux/nfs.h>
diff -urN linux-2.4.2-pre2/fs/nfsd/nfsfh.c linux/fs/nfsd/nfsfh.c
--- linux-2.4.2-pre2/fs/nfsd/nfsfh.c	Thu Jan  4 12:50:17 2001
+++ linux/fs/nfsd/nfsfh.c	Mon Dec  3 22:28:21 2001
@@ -9,7 +9,7 @@
  */
 
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fs.h>
 #include <linux/unistd.h>
 #include <linux/string.h>
@@ -454,6 +454,7 @@
 		if (tmp != dentry) {
 			/* we lost a race,  try again
 			 */
+			dput(pdentry);
 			dput(tmp);
 			dput(dentry);
 			dput(result);	/* this will discard the whole free path, so we can up the semaphore */
diff -urN linux-2.4.2-pre2/fs/nfsd/nfsproc.c linux/fs/nfsd/nfsproc.c
--- linux-2.4.2-pre2/fs/nfsd/nfsproc.c	Mon Jun 26 11:44:15 2000
+++ linux/fs/nfsd/nfsproc.c	Mon Dec  3 22:28:21 2001
@@ -18,7 +18,7 @@
 #include <linux/in.h>
 #include <linux/version.h>
 #include <linux/unistd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
@@ -252,8 +252,19 @@
 	if (attr->ia_valid & ATTR_MODE) { 
 		type = attr->ia_mode & S_IFMT;
 		mode = attr->ia_mode & ~S_IFMT;
-		if (!type)	/* HP weirdness */
-			type = S_IFREG;
+		if (!type) {
+			/* no type, so if target exists, assume same as that,
+			 * else assume a file */
+			if (inode) {
+				type = inode->i_mode & S_IFMT;
+				if (type == S_IFCHR || type == S_IFBLK) {
+					/* reserve rdev for later checking */
+					attr->ia_size = inode->i_rdev;
+					attr->ia_valid |= ATTR_SIZE;
+				}
+			} else
+				type = S_IFREG;
+		}
 	} else if (inode) {
 		type = inode->i_mode & S_IFMT;
 		mode = inode->i_mode & ~S_IFMT;
diff -urN linux-2.4.2-pre2/fs/nfsd/nfssvc.c linux/fs/nfsd/nfssvc.c
--- linux-2.4.2-pre2/fs/nfsd/nfssvc.c	Sun Oct  1 20:35:16 2000
+++ linux/fs/nfsd/nfssvc.c	Mon Dec  3 22:28:21 2001
@@ -19,7 +19,7 @@
 #include <linux/uio.h>
 #include <linux/version.h>
 #include <linux/unistd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 
diff -urN linux-2.4.2-pre2/fs/nfsd/nfsxdr.c linux/fs/nfsd/nfsxdr.c
--- linux-2.4.2-pre2/fs/nfsd/nfsxdr.c	Fri Sep 22 14:21:19 2000
+++ linux/fs/nfsd/nfsxdr.c	Mon Dec  3 22:28:21 2001
@@ -26,7 +26,7 @@
  * Mapping of S_IF* types to NFS file types
  */
 static u32	nfs_ftypes[] = {
-	NFNON,  NFFIFO, NFCHR, NFBAD,
+	NFNON,  NFCHR,  NFCHR, NFBAD,
 	NFDIR,  NFBAD,  NFBLK, NFBAD,
 	NFREG,  NFBAD,  NFLNK, NFBAD,
 	NFSOCK, NFBAD,  NFLNK, NFBAD,
@@ -136,20 +136,25 @@
 static inline u32 *
 encode_fattr(struct svc_rqst *rqstp, u32 *p, struct inode *inode)
 {
+	int type = (inode->i_mode & S_IFMT);
 	if (!inode)
 		return 0;
-	*p++ = htonl(nfs_ftypes[(inode->i_mode & S_IFMT) >> 12]);
+	*p++ = htonl(nfs_ftypes[type >> 12]);
 	*p++ = htonl((u32) inode->i_mode);
 	*p++ = htonl((u32) inode->i_nlink);
 	*p++ = htonl((u32) nfsd_ruid(rqstp, inode->i_uid));
 	*p++ = htonl((u32) nfsd_rgid(rqstp, inode->i_gid));
-	if (S_ISLNK(inode->i_mode) && inode->i_size > NFS_MAXPATHLEN) {
+
+	if (S_ISLNK(type) && inode->i_size > NFS_MAXPATHLEN) {
 		*p++ = htonl(NFS_MAXPATHLEN);
 	} else {
 		*p++ = htonl((u32) inode->i_size);
 	}
 	*p++ = htonl((u32) inode->i_blksize);
-	*p++ = htonl((u32) inode->i_rdev);
+	if (S_ISCHR(type) || S_ISBLK(type))
+		*p++ = htonl((u32) inode->i_rdev);
+	else
+		*p++ = htonl(0xffffffff);
 	*p++ = htonl((u32) inode->i_blocks);
 	*p++ = htonl((u32) inode->i_dev);
 	*p++ = htonl((u32) inode->i_ino);
diff -urN linux-2.4.2-pre2/fs/nfsd/vfs.c linux/fs/nfsd/vfs.c
--- linux-2.4.2-pre2/fs/nfsd/vfs.c	Fri Dec 29 14:07:23 2000
+++ linux/fs/nfsd/vfs.c	Mon Dec  3 22:28:21 2001
@@ -29,7 +29,7 @@
 #include <linux/fcntl.h>
 #include <linux/net.h>
 #include <linux/unistd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/in.h>
 #define __NO_VERSION__
 #include <linux/module.h>
diff -urN linux-2.4.2-pre2/fs/nls/nls_base.c linux/fs/nls/nls_base.c
--- linux-2.4.2-pre2/fs/nls/nls_base.c	Mon Oct 16 12:58:51 2000
+++ linux/fs/nls/nls_base.c	Mon Dec  3 22:28:21 2001
@@ -13,7 +13,7 @@
 #include <linux/string.h>
 #include <linux/config.h>
 #include <linux/nls.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
 #ifdef CONFIG_KMOD
 #include <linux/kmod.h>
diff -urN linux-2.4.2-pre2/fs/open.c linux/fs/open.c
--- linux-2.4.2-pre2/fs/open.c	Thu Oct 26 08:11:21 2000
+++ linux/fs/open.c	Mon Dec  3 22:28:21 2001
@@ -13,6 +13,7 @@
 #include <linux/dnotify.h>
 #include <linux/module.h>
 #include <linux/slab.h>
+#include <linux/tty.h>
 
 #include <asm/uaccess.h>
 
diff -urN linux-2.4.2-pre2/fs/openpromfs/inode.c linux/fs/openpromfs/inode.c
--- linux-2.4.2-pre2/fs/openpromfs/inode.c	Sat Aug 12 12:08:50 2000
+++ linux/fs/openpromfs/inode.c	Mon Dec  3 22:28:21 2001
@@ -12,7 +12,7 @@
 #include <linux/openprom_fs.h>
 #include <linux/locks.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/smp_lock.h>
 
 #include <asm/openprom.h>
diff -urN linux-2.4.2-pre2/fs/pipe.c linux/fs/pipe.c
--- linux-2.4.2-pre2/fs/pipe.c	Thu Nov 16 13:18:26 2000
+++ linux/fs/pipe.c	Mon Dec  3 22:28:21 2001
@@ -7,11 +7,12 @@
 #include <linux/mm.h>
 #include <linux/file.h>
 #include <linux/poll.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/init.h>
 
 #include <asm/uaccess.h>
+#include <asm/ioctls.h>
 
 /*
  * We use a start+len construction, which provides full use of the 
diff -urN linux-2.4.2-pre2/fs/qnx4/inode.c linux/fs/qnx4/inode.c
--- linux-2.4.2-pre2/fs/qnx4/inode.c	Fri Dec 29 14:07:57 2000
+++ linux/fs/qnx4/inode.c	Mon Dec  3 22:28:21 2001
@@ -17,7 +17,7 @@
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/qnx4_fs.h>
 #include <linux/fs.h>
 #include <linux/locks.h>
diff -urN linux-2.4.2-pre2/fs/qnx4/truncate.c linux/fs/qnx4/truncate.c
--- linux-2.4.2-pre2/fs/qnx4/truncate.c	Tue Sep  1 10:43:13 1998
+++ linux/fs/qnx4/truncate.c	Mon Dec  3 22:28:21 2001
@@ -13,7 +13,7 @@
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/qnx4_fs.h>
 #include <linux/fs.h>
 #include <linux/locks.h>
diff -urN linux-2.4.2-pre2/fs/read_write.c linux/fs/read_write.c
--- linux-2.4.2-pre2/fs/read_write.c	Fri Sep 22 14:21:19 2000
+++ linux/fs/read_write.c	Mon Dec  3 22:28:21 2001
@@ -4,7 +4,7 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
-#include <linux/malloc.h> 
+#include <linux/slab.h> 
 #include <linux/stat.h>
 #include <linux/fcntl.h>
 #include <linux/file.h>
diff -urN linux-2.4.2-pre2/fs/romfs/inode.c linux/fs/romfs/inode.c
--- linux-2.4.2-pre2/fs/romfs/inode.c	Fri Dec 29 14:07:57 2000
+++ linux/fs/romfs/inode.c	Mon Dec  3 22:28:21 2001
@@ -67,7 +67,7 @@
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/romfs_fs.h>
 #include <linux/fs.h>
 #include <linux/locks.h>
diff -urN linux-2.4.2-pre2/fs/select.c linux/fs/select.c
--- linux-2.4.2-pre2/fs/select.c	Thu Nov 16 12:54:18 2000
+++ linux/fs/select.c	Mon Dec  3 22:28:21 2001
@@ -14,7 +14,7 @@
  *     of fds to overcome nfds < 16390 descriptors limit (Tigran Aivazian).
  */
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/poll.h>
 #include <linux/file.h>
diff -urN linux-2.4.2-pre2/fs/smbfs/file.c linux/fs/smbfs/file.c
--- linux-2.4.2-pre2/fs/smbfs/file.c	Fri Dec 29 14:07:57 2000
+++ linux/fs/smbfs/file.c	Mon Dec  3 22:28:21 2001
@@ -13,7 +13,7 @@
 #include <linux/fcntl.h>
 #include <linux/stat.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pagemap.h>
 #include <linux/smp_lock.h>
 
diff -urN linux-2.4.2-pre2/fs/smbfs/inode.c linux/fs/smbfs/inode.c
--- linux-2.4.2-pre2/fs/smbfs/inode.c	Sun Dec 10 08:48:18 2000
+++ linux/fs/smbfs/inode.c	Mon Dec  3 22:28:21 2001
@@ -16,7 +16,7 @@
 #include <linux/stat.h>
 #include <linux/errno.h>
 #include <linux/locks.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/file.h>
 #include <linux/dcache.h>
diff -urN linux-2.4.2-pre2/fs/smbfs/proc.c linux/fs/smbfs/proc.c
--- linux-2.4.2-pre2/fs/smbfs/proc.c	Sun Dec 10 08:48:18 2000
+++ linux/fs/smbfs/proc.c	Mon Dec  3 22:28:21 2001
@@ -9,7 +9,7 @@
 
 #include <linux/types.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/fs.h>
 #include <linux/file.h>
 #include <linux/stat.h>
diff -urN linux-2.4.2-pre2/fs/super.c linux/fs/super.c
--- linux-2.4.2-pre2/fs/super.c	Mon Jan 15 20:53:11 2001
+++ linux/fs/super.c	Mon Dec  3 22:28:21 2001
@@ -22,12 +22,13 @@
 
 #include <linux/config.h>
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/locks.h>
 #include <linux/smp_lock.h>
 #include <linux/devfs_fs_kernel.h>
 #include <linux/fd.h>
 #include <linux/init.h>
+#include <linux/major.h>
 #include <linux/quotaops.h>
 #include <linux/acct.h>
 
diff -urN linux-2.4.2-pre2/fs/udf/dir.c linux/fs/udf/dir.c
--- linux-2.4.2-pre2/fs/udf/dir.c	Fri Nov 17 11:36:27 2000
+++ linux/fs/udf/dir.c	Mon Dec  3 22:28:21 2001
@@ -38,7 +38,7 @@
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/udf_fs.h>
 #endif
 
diff -urN linux-2.4.2-pre2/fs/udf/namei.c linux/fs/udf/namei.c
--- linux-2.4.2-pre2/fs/udf/namei.c	Tue Sep  5 14:07:30 2000
+++ linux/fs/udf/namei.c	Mon Dec  3 22:28:21 2001
@@ -31,7 +31,7 @@
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/quotaops.h>
 #include <linux/udf_fs.h>
 
diff -urN linux-2.4.2-pre2/fs/udf/partition.c linux/fs/udf/partition.c
--- linux-2.4.2-pre2/fs/udf/partition.c	Thu Mar  2 11:17:32 2000
+++ linux/fs/udf/partition.c	Mon Dec  3 22:28:21 2001
@@ -30,7 +30,7 @@
 #include <linux/fs.h>
 #include <linux/string.h>
 #include <linux/udf_fs.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 inline Uint32 udf_get_pblock(struct super_block *sb, Uint32 block, Uint16 partition, Uint32 offset)
 {
diff -urN linux-2.4.2-pre2/fs/udf/super.c linux/fs/udf/super.c
--- linux-2.4.2-pre2/fs/udf/super.c	Tue Sep  5 14:07:30 2000
+++ linux/fs/udf/super.c	Mon Dec  3 22:28:21 2001
@@ -48,7 +48,7 @@
 #include <linux/config.h>
 #include <linux/version.h>
 #include <linux/blkdev.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/kernel.h>
 #include <linux/locks.h>
 #include <linux/module.h>
diff -urN linux-2.4.2-pre2/fs/udf/symlink.c linux/fs/udf/symlink.c
--- linux-2.4.2-pre2/fs/udf/symlink.c	Fri Dec 29 14:07:57 2000
+++ linux/fs/udf/symlink.c	Mon Dec  3 22:28:21 2001
@@ -32,7 +32,7 @@
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/stat.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pagemap.h>
 #include <linux/smp_lock.h>
 #include "udf_i.h"
diff -urN linux-2.4.2-pre2/fs/ufs/super.c linux/fs/ufs/super.c
--- linux-2.4.2-pre2/fs/ufs/super.c	Tue Sep  5 14:07:30 2000
+++ linux/fs/ufs/super.c	Mon Dec  3 22:28:21 2001
@@ -73,7 +73,7 @@
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/ufs_fs.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/stat.h>
 #include <linux/string.h>
diff -urN linux-2.4.2-pre2/fs/ufs/util.c linux/fs/ufs/util.c
--- linux-2.4.2-pre2/fs/ufs/util.c	Tue Sep  5 14:07:30 2000
+++ linux/fs/ufs/util.c	Mon Dec  3 22:28:21 2001
@@ -7,7 +7,7 @@
  */
  
 #include <linux/string.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/locks.h>
 
 #include "swab.h"
diff -urN linux-2.4.2-pre2/fs/umsdos/dir.c linux/fs/umsdos/dir.c
--- linux-2.4.2-pre2/fs/umsdos/dir.c	Wed Nov  8 19:01:34 2000
+++ linux/fs/umsdos/dir.c	Mon Dec  3 22:28:21 2001
@@ -15,7 +15,7 @@
 #include <linux/stat.h>
 #include <linux/limits.h>
 #include <linux/umsdos_fs.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/pagemap.h>
 
 #define UMSDOS_SPECIAL_DIRFPOS	3
diff -urN linux-2.4.2-pre2/fs/umsdos/namei.c linux/fs/umsdos/namei.c
--- linux-2.4.2-pre2/fs/umsdos/namei.c	Wed Aug  2 12:06:11 2000
+++ linux/fs/umsdos/namei.c	Mon Dec  3 22:28:21 2001
@@ -20,7 +20,7 @@
 #include <linux/string.h>
 #include <linux/msdos_fs.h>
 #include <linux/umsdos_fs.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #define UMSDOS_DIR_LOCK
 
diff -urN linux-2.4.2-pre2/fs/umsdos/rdir.c linux/fs/umsdos/rdir.c
--- linux-2.4.2-pre2/fs/umsdos/rdir.c	Fri Aug 11 14:29:01 2000
+++ linux/fs/umsdos/rdir.c	Mon Dec  3 22:28:21 2001
@@ -14,7 +14,7 @@
 #include <linux/stat.h>
 #include <linux/limits.h>
 #include <linux/umsdos_fs.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <asm/uaccess.h>
 
diff -urN linux-2.4.2-pre2/fs/vfat/namei.c linux/fs/vfat/namei.c
--- linux-2.4.2-pre2/fs/vfat/namei.c	Sun Dec 31 10:26:17 2000
+++ linux/fs/vfat/namei.c	Mon Dec  3 22:28:21 2001
@@ -24,7 +24,7 @@
 #include <linux/ctype.h>
 #include <linux/stat.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include "../fat/msbuffer.h"
 
diff -urN linux-2.4.2-pre2/include/asm-alpha/errno.h linux/include/asm-alpha/errno.h
--- linux-2.4.2-pre2/include/asm-alpha/errno.h	Mon Jan 15 12:42:32 2001
+++ linux/include/asm-alpha/errno.h	Mon Dec  3 22:28:21 2001
@@ -139,6 +139,4 @@
 #define ENOMEDIUM	129	/* No medium found */
 #define EMEDIUMTYPE	130	/* Wrong medium type */
 
-#define EHASHCOLLISION  131     /* Number of hash collisons exceeds maximum generation counter value.  */
-
 #endif
diff -urN linux-2.4.2-pre2/include/asm-i386/errno.h linux/include/asm-i386/errno.h
--- linux-2.4.2-pre2/include/asm-i386/errno.h	Mon Jan 15 12:42:32 2001
+++ linux/include/asm-i386/errno.h	Mon Dec  3 22:28:21 2001
@@ -128,6 +128,5 @@
 
 #define	ENOMEDIUM	123	/* No medium found */
 #define	EMEDIUMTYPE	124	/* Wrong medium type */
-#define	EHASHCOLLISION	125	/* Number of hash collisons exceeds maximum generation counter value.  */
 
 #endif
diff -urN linux-2.4.2-pre2/include/asm-m68k/errno.h linux/include/asm-m68k/errno.h
--- linux-2.4.2-pre2/include/asm-m68k/errno.h	Mon Dec  3 22:28:13 2001
+++ linux/include/asm-m68k/errno.h	Mon Apr 14 16:28:19 1997
@@ -129,6 +129,4 @@
 #define	ENOMEDIUM	123	/* No medium found */
 #define	EMEDIUMTYPE	124	/* Wrong medium type */
 
-#define	EHASHCOLLISION	125	/* Number of hash collisons exceeds maximum generation counter value.  */
-
 #endif /* _M68K_ERRNO_H */
diff -urN linux-2.4.2-pre2/include/asm-sparc/termios.h linux/include/asm-sparc/termios.h
--- linux-2.4.2-pre2/include/asm-sparc/termios.h	Mon Dec  3 22:28:13 2001
+++ linux/include/asm-sparc/termios.h	Mon Dec  3 22:28:21 2001
@@ -1,4 +1,4 @@
-/* $Id: termios.h,v 1.30 1999/12/02 09:57:46 davem Exp $ */
+/* $Id: termios.h,v 1.31 2001/02/05 05:54:29 davem Exp $ */
 #ifndef _SPARC_TERMIOS_H
 #define _SPARC_TERMIOS_H
 
diff -urN linux-2.4.2-pre2/include/asm-sparc64/termios.h linux/include/asm-sparc64/termios.h
--- linux-2.4.2-pre2/include/asm-sparc64/termios.h	Mon Dec  3 22:28:13 2001
+++ linux/include/asm-sparc64/termios.h	Mon Dec  3 22:28:21 2001
@@ -1,4 +1,4 @@
-/* $Id: termios.h,v 1.9 1999/12/02 09:57:53 davem Exp $ */
+/* $Id: termios.h,v 1.10 2001/02/05 05:54:29 davem Exp $ */
 #ifndef _SPARC64_TERMIOS_H
 #define _SPARC64_TERMIOS_H
 
diff -urN linux-2.4.2-pre2/include/linux/acpi.h linux/include/linux/acpi.h
--- linux-2.4.2-pre2/include/linux/acpi.h	Mon Jan 29 10:15:59 2001
+++ linux/include/linux/acpi.h	Mon Dec  3 22:28:21 2001
@@ -82,13 +82,11 @@
 /* PM_TMR masks */
 #define ACPI_TMR_VAL_EXT 0x00000100
 #define ACPI_TMR_MASK	 0x00ffffff
-#define ACPI_TMR_HZ	 3580000 /* 3.58 MHz */
+#define ACPI_TMR_HZ	 3579545 /* 3.58 MHz */
+#define ACPI_TMR_KHZ	 (ACPI_TMR_HZ / 1000)
 
-/* strangess to avoid integer overflow */
 #define ACPI_MICROSEC_TO_TMR_TICKS(val) \
-  (((val) * (ACPI_TMR_HZ / 10000)) / 100)
-#define ACPI_TMR_TICKS_TO_MICROSEC(ticks) \
-  (((ticks) * 100) / (ACPI_TMR_HZ / 10000))
+  (((val) * (ACPI_TMR_KHZ)) / 1000)
 
 /* PM2_CNT flags */
 #define ACPI_ARB_DIS 0x01
@@ -147,6 +145,9 @@
 	ACPI_C1_TIME,
 	ACPI_C2_TIME,
 	ACPI_C3_TIME,
+	ACPI_C1_COUNT,
+	ACPI_C2_COUNT,
+	ACPI_C3_COUNT,
 	ACPI_S0_SLP_TYP,
 	ACPI_S1_SLP_TYP,
 	ACPI_S5_SLP_TYP,
diff -urN linux-2.4.2-pre2/include/linux/coda_linux.h linux/include/linux/coda_linux.h
--- linux-2.4.2-pre2/include/linux/coda_linux.h	Mon Dec 11 13:25:00 2000
+++ linux/include/linux/coda_linux.h	Mon Dec  3 22:28:21 2001
@@ -17,7 +17,7 @@
 #include <linux/sched.h> 
 #include <linux/mm.h>
 #include <linux/vmalloc.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/wait.h>		
 #include <linux/types.h>
 #include <linux/fs.h>
diff -urN linux-2.4.2-pre2/include/linux/elevator.h linux/include/linux/elevator.h
--- linux-2.4.2-pre2/include/linux/elevator.h	Mon Jan 15 13:08:15 2001
+++ linux/include/linux/elevator.h	Mon Dec  3 22:28:21 2001
@@ -1,8 +1,6 @@
 #ifndef _LINUX_ELEVATOR_H
 #define _LINUX_ELEVATOR_H
 
-#define ELEVATOR_DEBUG
-
 typedef void (elevator_fn) (struct request *, elevator_t *,
 			    struct list_head *,
 			    struct list_head *, int);
@@ -68,8 +66,9 @@
 	 (s1)->rq_dev < (s2)->rq_dev)
 
 #define BHRQ_IN_ORDER(bh, rq)			\
-	(((bh)->b_rdev == (rq)->rq_dev &&	\
-	  (bh)->b_rsector < (rq)->sector))
+	((((bh)->b_rdev == (rq)->rq_dev &&	\
+	   (bh)->b_rsector < (rq)->sector)) ||	\
+	 (bh)->b_rdev < (rq)->rq_dev)
 
 static inline int elevator_request_latency(elevator_t * elevator, int rw)
 {
diff -urN linux-2.4.2-pre2/include/linux/hfs_sysdep.h linux/include/linux/hfs_sysdep.h
--- linux-2.4.2-pre2/include/linux/hfs_sysdep.h	Mon Dec 11 13:25:24 2000
+++ linux/include/linux/hfs_sysdep.h	Mon Dec  3 22:28:21 2001
@@ -17,7 +17,7 @@
 #ifndef _HFS_SYSDEP_H
 #define _HFS_SYSDEP_H
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/locks.h>
 #include <linux/fs.h>
diff -urN linux-2.4.2-pre2/include/linux/highmem.h linux/include/linux/highmem.h
--- linux-2.4.2-pre2/include/linux/highmem.h	Mon Jan 29 23:24:56 2001
+++ linux/include/linux/highmem.h	Mon Dec  3 22:28:21 2001
@@ -38,7 +38,7 @@
 #define kunmap_atomic(page,idx)		kunmap(page)
 
 #define bh_kmap(bh)	((bh)->b_data)
-#define bh_kunmap(bh)	do { } while (0);
+#define bh_kunmap(bh)	do { } while (0)
 
 #endif /* CONFIG_HIGHMEM */
 
diff -urN linux-2.4.2-pre2/include/linux/interrupt.h linux/include/linux/interrupt.h
--- linux-2.4.2-pre2/include/linux/interrupt.h	Mon Jan 29 23:24:56 2001
+++ linux/include/linux/interrupt.h	Mon Dec  3 22:28:21 2001
@@ -146,7 +146,7 @@
 
 #ifdef CONFIG_SMP
 #define tasklet_trylock(t) (!test_and_set_bit(TASKLET_STATE_RUN, &(t)->state))
-#define tasklet_unlock_wait(t) while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { /* NOTHING */ }
+#define tasklet_unlock_wait(t) while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); }
 #define tasklet_unlock(t) clear_bit(TASKLET_STATE_RUN, &(t)->state)
 #else
 #define tasklet_trylock(t) 1
diff -urN linux-2.4.2-pre2/include/linux/isdn.h linux/include/linux/isdn.h
--- linux-2.4.2-pre2/include/linux/isdn.h	Mon Dec  3 22:28:13 2001
+++ linux/include/linux/isdn.h	Mon Dec  3 22:28:21 2001
@@ -196,7 +196,7 @@
 #include <asm/io.h>
 #include <linux/kernel.h>
 #include <linux/signal.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/timer.h>
 #include <linux/wait.h>
 #include <linux/tty.h>
diff -urN linux-2.4.2-pre2/include/linux/mtd/map.h linux/include/linux/mtd/map.h
--- linux-2.4.2-pre2/include/linux/mtd/map.h	Mon Dec  3 22:28:13 2001
+++ linux/include/linux/mtd/map.h	Mon Dec  3 22:28:21 2001
@@ -8,7 +8,7 @@
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/mtd/mtd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 /* The map stuff is very simple. You fill in your struct map_info with
    a handful of routines for accessing the device, making sure they handle
diff -urN linux-2.4.2-pre2/include/linux/ncp_fs.h linux/include/linux/ncp_fs.h
--- linux-2.4.2-pre2/include/linux/ncp_fs.h	Mon Dec 11 13:26:24 2000
+++ linux/include/linux/ncp_fs.h	Mon Dec  3 22:28:21 2001
@@ -196,7 +196,7 @@
 
 #ifdef DEBUG_NCP_MALLOC
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 extern int ncp_malloced;
 extern int ncp_current_malloced;
diff -urN linux-2.4.2-pre2/include/linux/pci.h linux/include/linux/pci.h
--- linux-2.4.2-pre2/include/linux/pci.h	Mon Jan 29 23:25:43 2001
+++ linux/include/linux/pci.h	Mon Dec  3 22:28:21 2001
@@ -565,9 +565,9 @@
 { 	return PCIBIOS_DEVICE_NOT_FOUND; }
 
 #define _PCI_NOP(o,s,t) \
-	static inline int pcibios_##o##_config_##s## (u8 bus, u8 dfn, u8 where, t val) \
+	static inline int pcibios_##o##_config_##s (u8 bus, u8 dfn, u8 where, t val) \
 		{ return PCIBIOS_FUNC_NOT_SUPPORTED; } \
-	static inline int pci_##o##_config_##s## (struct pci_dev *dev, int where, t val) \
+	static inline int pci_##o##_config_##s (struct pci_dev *dev, int where, t val) \
 		{ return PCIBIOS_FUNC_NOT_SUPPORTED; }
 #define _PCI_NOP_ALL(o,x)	_PCI_NOP(o,byte,u8 x) \
 				_PCI_NOP(o,word,u16 x) \
diff -urN linux-2.4.2-pre2/include/linux/proc_fs.h linux/include/linux/proc_fs.h
--- linux-2.4.2-pre2/include/linux/proc_fs.h	Mon Jan 29 23:25:13 2001
+++ linux/include/linux/proc_fs.h	Mon Dec  3 22:28:21 2001
@@ -2,7 +2,7 @@
 #define _LINUX_PROC_FS_H
 
 #include <linux/config.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 /*
  * The proc filesystem constants/structures
diff -urN linux-2.4.2-pre2/include/linux/raid/raid5.h linux/include/linux/raid/raid5.h
--- linux-2.4.2-pre2/include/linux/raid/raid5.h	Fri Dec 29 14:07:24 2000
+++ linux/include/linux/raid/raid5.h	Mon Dec  3 22:28:21 2001
@@ -57,9 +57,9 @@
  *
  * Buffers for the md device that arrive via make_request are attached
  * to the appropriate stripe in one of two lists linked on b_reqnext.
- * One list for read requests, one for write.  There should never be
- * more than one buffer on the two lists together, but we are not
- * guaranteed of that so we allow for more.
+ * One list (bh_read) for read requests, one (bh_write) for write.
+ * There should never be more than one buffer on the two lists
+ * together, but we are not guaranteed of that so we allow for more.
  *
  * If a buffer is on the read list when the associated cache buffer is
  * Uptodate, the data is copied into the read buffer and it's b_end_io
@@ -70,16 +70,18 @@
  * that the Uptodate bit is set.  Once they have checked that they may
  * take buffers off the read queue.
  *
- * When a buffer on the write_list is committed for write, it is
- * marked clean, copied into the cache buffer, which is then marked
- * dirty, and moved onto a third list, the written list.  Once both
- * the parity block and the cached buffer are successfully written,
- * any buffer on a written list can be returned with b_end_io.
+ * When a buffer on the write list is committed for write is it copied
+ * into the cache buffer, which is then marked dirty, and moved onto a
+ * third list, the written list (bh_written).  Once both the parity
+ * block and the cached buffer are successfully written, any buffer on
+ * a written list can be returned with b_end_io.
  *
- * The write_list and read_list lists act as fifos.  They are protected by the
- * device_lock which can be claimed when a stripe_lock is held.
- * The device_lock is only for list manipulations and will only be held for a very
- * short time.  It can be claimed from interrupts.
+ * The write list and read list both act as fifos.  The read list is
+ * protected by the device_lock.  The write and written lists are
+ * protected by the stripe lock.  The device_lock, which can be
+ * claimed while the stipe lock is held, is only for list
+ * manipulations and will only be held for a very short time.  It can
+ * be claimed from interrupts.
  *
  *
  * Stripes in the stripe cache can be on one of two lists (or on
diff -urN linux-2.4.2-pre2/include/linux/reiserfs_fs.h linux/include/linux/reiserfs_fs.h
--- linux-2.4.2-pre2/include/linux/reiserfs_fs.h	Mon Jan 15 13:23:01 2001
+++ linux/include/linux/reiserfs_fs.h	Mon Dec  3 22:28:21 2001
@@ -15,7 +15,7 @@
 
 #include <linux/types.h>
 #ifdef __KERNEL__
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/tqueue.h>
 #endif
 
diff -urN linux-2.4.2-pre2/include/linux/skbuff.h linux/include/linux/skbuff.h
--- linux-2.4.2-pre2/include/linux/skbuff.h	Mon Jan 29 23:25:27 2001
+++ linux/include/linux/skbuff.h	Mon Dec  3 22:28:21 2001
@@ -153,7 +153,7 @@
 /*
  *	Handling routines are only of interest to the kernel
  */
-#include <linux/malloc.h>
+#include <linux/slab.h>
 
 #include <asm/system.h>
 
diff -urN linux-2.4.2-pre2/include/net/ip_fib.h linux/include/net/ip_fib.h
--- linux-2.4.2-pre2/include/net/ip_fib.h	Mon Dec 11 13:30:49 2000
+++ linux/include/net/ip_fib.h	Mon Dec  3 22:28:21 2001
@@ -276,4 +276,4 @@
 }
 
 
-#endif  _NET_FIB_H
+#endif  /* _NET_FIB_H */
diff -urN linux-2.4.2-pre2/ipc/msg.c linux/ipc/msg.c
--- linux-2.4.2-pre2/ipc/msg.c	Tue Jan 11 21:49:26 2000
+++ linux/ipc/msg.c	Mon Dec  3 22:28:21 2001
@@ -16,7 +16,7 @@
  */
 
 #include <linux/config.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/msg.h>
 #include <linux/spinlock.h>
 #include <linux/init.h>
diff -urN linux-2.4.2-pre2/ipc/sem.c linux/ipc/sem.c
--- linux-2.4.2-pre2/ipc/sem.c	Thu Oct 12 14:19:32 2000
+++ linux/ipc/sem.c	Mon Dec  3 22:28:21 2001
@@ -56,7 +56,7 @@
  */
 
 #include <linux/config.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/init.h>
 #include <linux/proc_fs.h>
diff -urN linux-2.4.2-pre2/ipc/shm.c linux/ipc/shm.c
--- linux-2.4.2-pre2/ipc/shm.c	Sun Jan 14 11:22:21 2001
+++ linux/ipc/shm.c	Mon Dec  3 22:28:21 2001
@@ -16,7 +16,7 @@
  */
 
 #include <linux/config.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/shm.h>
 #include <linux/init.h>
 #include <linux/file.h>
diff -urN linux-2.4.2-pre2/ipc/util.c linux/ipc/util.c
--- linux-2.4.2-pre2/ipc/util.c	Fri Dec 29 14:07:24 2000
+++ linux/ipc/util.c	Mon Dec  3 22:28:21 2001
@@ -17,7 +17,7 @@
 #include <linux/msg.h>
 #include <linux/smp_lock.h>
 #include <linux/vmalloc.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/highuid.h>
 
 #if defined(CONFIG_SYSVIPC)
diff -urN linux-2.4.2-pre2/kernel/acct.c linux/kernel/acct.c
--- linux-2.4.2-pre2/kernel/acct.c	Sat Jul  8 19:43:35 2000
+++ linux/kernel/acct.c	Mon Dec  3 22:28:21 2001
@@ -53,6 +53,7 @@
 #include <linux/acct.h>
 #include <linux/smp_lock.h>
 #include <linux/file.h>
+#include <linux/tty.h>
 
 #include <asm/uaccess.h>
 
diff -urN linux-2.4.2-pre2/kernel/exit.c linux/kernel/exit.c
--- linux-2.4.2-pre2/kernel/exit.c	Thu Jan  4 01:00:35 2001
+++ linux/kernel/exit.c	Mon Dec  3 22:28:21 2001
@@ -5,10 +5,11 @@
  */
 
 #include <linux/config.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/smp_lock.h>
 #include <linux/module.h>
+#include <linux/tty.h>
 #ifdef CONFIG_BSD_PROCESS_ACCT
 #include <linux/acct.h>
 #endif
diff -urN linux-2.4.2-pre2/kernel/fork.c linux/kernel/fork.c
--- linux-2.4.2-pre2/kernel/fork.c	Mon Jan 22 15:54:06 2001
+++ linux/kernel/fork.c	Mon Dec  3 22:28:21 2001
@@ -12,7 +12,7 @@
  */
 
 #include <linux/config.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/unistd.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.4.2-pre2/kernel/ksyms.c linux/kernel/ksyms.c
--- linux-2.4.2-pre2/kernel/ksyms.c	Sun Jan 28 16:11:20 2001
+++ linux/kernel/ksyms.c	Mon Dec  3 22:28:21 2001
@@ -10,7 +10,7 @@
  */
 
 #include <linux/config.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/blkdev.h>
 #include <linux/cdrom.h>
@@ -45,6 +45,7 @@
 #include <linux/highuid.h>
 #include <linux/brlock.h>
 #include <linux/fs.h>
+#include <linux/tty.h>
 
 #if defined(CONFIG_PROC_FS)
 #include <linux/proc_fs.h>
diff -urN linux-2.4.2-pre2/kernel/resource.c linux/kernel/resource.c
--- linux-2.4.2-pre2/kernel/resource.c	Wed Nov  8 17:09:50 2000
+++ linux/kernel/resource.c	Mon Dec  3 22:28:21 2001
@@ -11,7 +11,7 @@
 #include <linux/errno.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <asm/io.h>
 
diff -urN linux-2.4.2-pre2/kernel/sched.c linux/kernel/sched.c
--- linux-2.4.2-pre2/kernel/sched.c	Mon Dec  3 22:28:13 2001
+++ linux/kernel/sched.c	Mon Dec  3 22:28:21 2001
@@ -1115,11 +1115,11 @@
 	else
 		printk("\n");
 
-#ifdef CONFIG_X86
-/* This is very useful, but only works on x86 right now */
+#if defined(CONFIG_X86) || defined(CONFIG_SPARC64)
+/* This is very useful, but only works on x86 and sparc64 right now */
 	{
-		extern void show_trace(unsigned long);
-		show_trace(p->thread.esp);
+		extern void show_trace_task(struct task_struct *tsk);
+		show_trace_task(p);
 	}
 #endif
 }
diff -urN linux-2.4.2-pre2/kernel/sysctl.c linux/kernel/sysctl.c
--- linux-2.4.2-pre2/kernel/sysctl.c	Mon Dec  3 22:28:13 2001
+++ linux/kernel/sysctl.c	Mon Dec  3 22:28:21 2001
@@ -19,7 +19,7 @@
  */
 
 #include <linux/config.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/sysctl.h>
 #include <linux/swapctl.h>
 #include <linux/proc_fs.h>
diff -urN linux-2.4.2-pre2/mm/filemap.c linux/mm/filemap.c
--- linux-2.4.2-pre2/mm/filemap.c	Mon Jan 15 17:14:41 2001
+++ linux/mm/filemap.c	Mon Dec  3 22:28:21 2001
@@ -9,7 +9,7 @@
  * most "normal" filesystems (but you don't /have/ to use this:
  * the NFS filesystem used to do this differently, for example)
  */
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/shm.h>
 #include <linux/mman.h>
 #include <linux/locks.h>
@@ -397,7 +397,7 @@
 	retval |= do_buffer_fdatasync(&inode->i_mapping->locked_pages, start_idx, end_idx, writeout_one_page);
 
 	/* now wait for locked buffers on pages from both clean and dirty lists */
-	retval |= do_buffer_fdatasync(&inode->i_mapping->dirty_pages, start_idx, end_idx, writeout_one_page);
+	retval |= do_buffer_fdatasync(&inode->i_mapping->dirty_pages, start_idx, end_idx, waitfor_one_page);
 	retval |= do_buffer_fdatasync(&inode->i_mapping->clean_pages, start_idx, end_idx, waitfor_one_page);
 	retval |= do_buffer_fdatasync(&inode->i_mapping->locked_pages, start_idx, end_idx, waitfor_one_page);
 
diff -urN linux-2.4.2-pre2/mm/swapfile.c linux/mm/swapfile.c
--- linux-2.4.2-pre2/mm/swapfile.c	Fri Dec 29 14:07:24 2000
+++ linux/mm/swapfile.c	Mon Dec  3 22:28:21 2001
@@ -5,7 +5,7 @@
  *  Swap reorganised 29.12.95, Stephen Tweedie
  */
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/smp_lock.h>
 #include <linux/kernel_stat.h>
 #include <linux/swap.h>
diff -urN linux-2.4.2-pre2/mm/vmalloc.c linux/mm/vmalloc.c
--- linux-2.4.2-pre2/mm/vmalloc.c	Mon Jan 15 16:54:20 2001
+++ linux/mm/vmalloc.c	Mon Dec  3 22:28:21 2001
@@ -6,7 +6,7 @@
  *  SMP-safe vmalloc/vfree/ioremap, Tigran Aivazian <tigran@veritas.com>, May 2000
  */
 
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/spinlock.h>
 #include <linux/highmem.h>
diff -urN linux-2.4.2-pre2/net/802/cl2llc.c linux/net/802/cl2llc.c
--- linux-2.4.2-pre2/net/802/cl2llc.c	Sat Nov 29 10:41:10 1997
+++ linux/net/802/cl2llc.c	Mon Dec  3 22:28:21 2001
@@ -28,7 +28,7 @@
 
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <net/p8022.h>
@@ -96,7 +96,7 @@
 				else
 					llc_interpret_pseudo_code(lp, REJECT1, skb, NO_FRAME);
 				break;
-			default:
+			default:;
 		}
 		if(lp->llc_callbacks)
 		{
@@ -497,7 +497,7 @@
 				else
 					lp->f_flag = fr->i_hdr.i_pflag;
 				break;
-			default:
+			default:;
 		}
 		pc++;	
 	}
diff -urN linux-2.4.2-pre2/net/802/llc_macinit.c linux/net/802/llc_macinit.c
--- linux-2.4.2-pre2/net/802/llc_macinit.c	Mon Oct 16 12:42:53 2000
+++ linux/net/802/llc_macinit.c	Mon Dec  3 22:28:21 2001
@@ -24,7 +24,7 @@
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/unistd.h>
 #include <linux/string.h>
 #include <linux/netdevice.h>
@@ -125,7 +125,7 @@
 				free=0;
 				break;
 
-			default:
+			default:;
 				/*
 				 *	All other type 1 pdus ignored for now
 				 */
diff -urN linux-2.4.2-pre2/net/802/llc_sendpdu.c linux/net/802/llc_sendpdu.c
--- linux-2.4.2-pre2/net/802/llc_sendpdu.c	Tue Feb 10 13:07:49 1998
+++ linux/net/802/llc_sendpdu.c	Mon Dec  3 22:28:21 2001
@@ -19,7 +19,7 @@
 
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <net/p8022.h>
diff -urN linux-2.4.2-pre2/net/Changes linux/net/Changes
--- linux-2.4.2-pre2/net/Changes	Fri Feb 18 14:51:22 2000
+++ linux/net/Changes	Wed Dec 31 16:00:00 1969
@@ -1,44 +0,0 @@
---------------- Things That Need Doing Before 2.2 ------------------
-
-o	insw_and_csum
-
--------------------------- Bugs to fix ------------------------------
-
-o	Should unix domain connect never block ?
-o	Screend loadable firewall module
-o	Remove kernel RARP and replace with user mode daemon.
-o	Merge ARM half word trap fixes for ethernet headers
-o	Stop route addition to downed interfaces
-o	Make sure route add window functionality is back or documented
-	equivalences are clear
-o	Merge ATM 
-o	Merge IRDA
-
-Possible projects for victim^H^H^H^H^Holunteers
-
-9.	Implementing streams. Not as a blind slow SYS5.4 style copy but actually
-working out how to do it so it runs like greased lightning. Quite a big
-problem. [See the LiS project]
-
-11.	IP over SCSI. [worked on]
-
-14.	Bidirectional PLIP. Also PLIP for the newer style parallel ports.
-
-15.	802.2LLC and thus Netbeui sockets. Becoming less important since the
-rumour is microsoft are phasing out netbeui for netbios/IP. Microsoft have
-gone for netbios/funny-ipx-variant it seems in Win95, but TCP is selectable.
-
-17.	PPP multilink. Another nasty job.
-
-19.	IPv4 IP-AH and IP-ESP.
-
-20.	(userspace) GUI interface to the bandwidth allocators so mere
-	mortals can do this
-
-
-BTW: Don't let the magic words 'kernel programming' worry you. Its like DOS
-- you make a mistake you have to reboot. You do at least get dumps and a
-kernel logger that is reliable. There is now a loadable module allowing
-use of gdb on the kernel (no breakpoints though!). No magic involved.
-
-Alan
diff -urN linux-2.4.2-pre2/net/Config.in linux/net/Config.in
--- linux-2.4.2-pre2/net/Config.in	Tue Oct 10 10:33:52 2000
+++ linux/net/Config.in	Mon Dec  3 22:28:21 2001
@@ -77,15 +77,15 @@
    tristate 'WAN router' CONFIG_WAN_ROUTER
    bool 'Fast switching (read help!)' CONFIG_NET_FASTROUTE
    bool 'Forwarding between high speed interfaces' CONFIG_NET_HW_FLOWCONTROL
-   if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
-      mainmenu_option next_comment
-      comment 'QoS and/or fair queueing'
-      bool 'QoS and/or fair queueing (EXPERIMENTAL)' CONFIG_NET_SCHED
-      if [ "$CONFIG_NET_SCHED" = "y" ]; then
-	 source net/sched/Config.in
-      fi
-#      bool 'Network code profiler' CONFIG_NET_PROFILE
-      endmenu
-   fi
 fi
+
+mainmenu_option next_comment
+comment 'QoS and/or fair queueing'
+bool 'QoS and/or fair queueing (EXPERIMENTAL)' CONFIG_NET_SCHED
+if [ "$CONFIG_NET_SCHED" = "y" ]; then
+   source net/sched/Config.in
+fi
+#bool 'Network code profiler' CONFIG_NET_PROFILE
+endmenu
+
 endmenu
diff -urN linux-2.4.2-pre2/net/appletalk/Makefile linux/net/appletalk/Makefile
--- linux-2.4.2-pre2/net/appletalk/Makefile	Fri Dec 29 14:07:24 2000
+++ linux/net/appletalk/Makefile	Mon Dec  3 22:28:21 2001
@@ -18,5 +18,3 @@
 
 include $(TOPDIR)/Rules.make
 
-tar:
-		tar -cvf /dev/f1 .
diff -urN linux-2.4.2-pre2/net/atm/common.c linux/net/atm/common.c
--- linux-2.4.2-pre2/net/atm/common.c	Mon Jan  1 09:54:07 2001
+++ linux/net/atm/common.c	Mon Dec  3 22:28:21 2001
@@ -26,6 +26,7 @@
 #include <asm/uaccess.h>
 #include <asm/atomic.h>
 #include <asm/poll.h>
+#include <asm/ioctls.h>
 
 #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
 #include <linux/atmlec.h>
@@ -376,6 +377,8 @@
 	if (error <= 0) return error;
 	vcc->timestamp = skb->stamp;
 	eff_len = skb->len > size ? size : skb->len;
+	if (skb->len > size) /* Not fit ?  Report it... */
+		m->msg_flags |= MSG_TRUNC;
 	if (vcc->dev->ops->feedback)
 		vcc->dev->ops->feedback(vcc,skb,(unsigned long) skb->data,
 		    (unsigned long) buff,eff_len);
diff -urN linux-2.4.2-pre2/net/atm/lec.h linux/net/atm/lec.h
--- linux-2.4.2-pre2/net/atm/lec.h	Mon Jan 22 13:30:21 2001
+++ linux/net/atm/lec.h	Mon Dec  3 22:28:21 2001
@@ -72,7 +72,7 @@
  * 2. LLC Data frames whose total length, including LLC field and data,
  *    but not padding required to meet the minimum data frame length, 
  *    is less than 1536(0x0600) MUST be encoded by placing that length
- *    in the the h_type field. The LLC field follows header immediatelly.
+ *    in the h_type field. The LLC field follows header immediatelly.
  * 3. LLC data frames longer than this maximum MUST be encoded by placing
  *    the value 0 in the h_type field.
  *
@@ -154,5 +154,5 @@
 
 void atm_lane_init(void);
 void atm_lane_init_ops(struct atm_lane_ops *ops);
-#endif _LEC_H_
+#endif /* _LEC_H_ */
 
diff -urN linux-2.4.2-pre2/net/ax25/Makefile linux/net/ax25/Makefile
--- linux-2.4.2-pre2/net/ax25/Makefile	Fri Dec 29 14:07:24 2000
+++ linux/net/ax25/Makefile	Mon Dec  3 22:28:21 2001
@@ -23,5 +23,3 @@
 
 include $(TOPDIR)/Rules.make
 
-tar:
-		tar -cvf /dev/f1 .
diff -urN linux-2.4.2-pre2/net/ax25/af_ax25.c linux/net/ax25/af_ax25.c
--- linux-2.4.2-pre2/net/ax25/af_ax25.c	Fri Dec 29 14:35:47 2000
+++ linux/net/ax25/af_ax25.c	Mon Dec  3 22:28:21 2001
@@ -1782,10 +1782,9 @@
 	return(len);
 }
 
-static struct net_proto_family ax25_family_ops =
-{
-	PF_AX25,
-	ax25_create
+static struct net_proto_family ax25_family_ops = {
+	family:		PF_AX25,
+	create:		ax25_create,
 };
 
 static struct proto_ops SOCKOPS_WRAPPED(ax25_proto_ops) = {
@@ -1814,18 +1813,13 @@
 /*
  *	Called by socket.c on kernel start up
  */
-static struct packet_type ax25_packet_type =
-{
-	0,	/* MUTTER ntohs(ETH_P_AX25),*/
-	0,		/* copy */
-	ax25_kiss_rcv,
-	NULL,
-	NULL,
+static struct packet_type ax25_packet_type = {
+	type:		__constant_htons(ETH_P_AX25),
+	func:		ax25_kiss_rcv,
 };
 
 static struct notifier_block ax25_dev_notifier = {
-	ax25_device_event,
-	0
+	notifier_call:	ax25_device_event,
 };
 
 EXPORT_SYMBOL(ax25_encapsulate);
@@ -1846,10 +1840,11 @@
 EXPORT_SYMBOL(null_ax25_address);
 EXPORT_SYMBOL(ax25_display_timer);
 
+static const char banner[] __initdata = KERN_INFO "NET4: G4KLX/GW4PTS AX.25 for Linux. Version 0.37 for Linux NET4.0\n";
+
 static int __init ax25_init(void)
 {
 	sock_register(&ax25_family_ops);
-	ax25_packet_type.type = htons(ETH_P_AX25);
 	dev_add_pack(&ax25_packet_type);
 	register_netdevice_notifier(&ax25_dev_notifier);
 	ax25_register_sysctl();
@@ -1858,7 +1853,7 @@
 	proc_net_create("ax25", 0, ax25_get_info);
 	proc_net_create("ax25_calls", 0, ax25_uid_get_info);
 
-	printk(KERN_INFO "NET4: G4KLX/GW4PTS AX.25 for Linux. Version 0.37 for Linux NET4.0\n");
+	printk(banner);
 	return 0;
 }
 module_init(ax25_init);
@@ -1879,7 +1874,6 @@
 	ax25_unregister_sysctl();
 	unregister_netdevice_notifier(&ax25_dev_notifier);
 
-	ax25_packet_type.type = htons(ETH_P_AX25);
 	dev_remove_pack(&ax25_packet_type);
 
 	sock_unregister(PF_AX25);
diff -urN linux-2.4.2-pre2/net/ax25/ax25_in.c linux/net/ax25/ax25_in.c
--- linux-2.4.2-pre2/net/ax25/ax25_in.c	Fri Dec 29 14:35:47 2000
+++ linux/net/ax25/ax25_in.c	Mon Dec  3 22:28:21 2001
@@ -36,6 +36,7 @@
  *	AX.25 036	Jonathan(G4KLX)	Move DAMA code into own file.
  *			Joerg(DL1BKE)	Fixed DAMA Slave.
  *	AX.25 037	Jonathan(G4KLX)	New timer architecture.
+ *			Thomas(DL9SAU)  Fixed missing initialization of skb->protocol.
  */
 
 #include <linux/config.h>
@@ -158,6 +159,7 @@
 		skb->nh.raw   = skb->data;
 		skb->dev      = ax25->ax25_dev->dev;
 		skb->pkt_type = PACKET_HOST;
+		skb->protocol = htons(ETH_P_IP);
 		ip_rcv(skb, skb->dev, NULL);	/* Wrong ptype */
 		return 1;
 	}
@@ -287,6 +289,7 @@
 				skb->nh.raw   = skb->data;
 				skb->dev      = dev;
 				skb->pkt_type = PACKET_HOST;
+				skb->protocol = htons(ETH_P_IP);
 				ip_rcv(skb, dev, ptype);	/* Note ptype here is the wrong one, fix me later */
 				break;
 
@@ -296,6 +299,7 @@
 				skb->nh.raw   = skb->data;
 				skb->dev      = dev;
 				skb->pkt_type = PACKET_HOST;
+				skb->protocol = htons(ETH_P_ARP);
 				arp_rcv(skb, dev, ptype);	/* Note ptype here is wrong... */
 				break;
 #endif
diff -urN linux-2.4.2-pre2/net/ax25/sysctl_net_ax25.c linux/net/ax25/sysctl_net_ax25.c
--- linux-2.4.2-pre2/net/ax25/sysctl_net_ax25.c	Sun Nov 12 20:37:17 2000
+++ linux/net/ax25/sysctl_net_ax25.c	Mon Dec  3 22:28:21 2001
@@ -27,8 +27,8 @@
 
 static struct ctl_table_header *ax25_table_header;
 
-static ctl_table *ax25_table = NULL;
-static int ax25_table_size   = 0;
+static ctl_table *ax25_table;
+static int ax25_table_size;
 
 static ctl_table ax25_dir_table[] = {
 	{NET_AX25, "ax25", NULL, 0, 0555, NULL},
diff -urN linux-2.4.2-pre2/net/bridge/br_private.h linux/net/bridge/br_private.h
--- linux-2.4.2-pre2/net/bridge/br_private.h	Mon Jan 22 13:30:21 2001
+++ linux/net/bridge/br_private.h	Mon Dec  3 22:28:21 2001
@@ -4,7 +4,7 @@
  *	Authors:
  *	Lennert Buytenhek		<buytenh@gnu.org>
  *
- *	$Id: br_private.h,v 1.4 2001/01/19 04:51:48 davem Exp $
+ *	$Id: br_private.h,v 1.5 2001/02/05 06:03:47 davem Exp $
  *
  *	This program is free software; you can redistribute it and/or
  *	modify it under the terms of the GNU General Public License
@@ -116,83 +116,83 @@
 extern unsigned char bridge_ula[6];
 
 /* br.c */
-void br_dec_use_count(void);
-void br_inc_use_count(void);
+extern void br_dec_use_count(void);
+extern void br_inc_use_count(void);
 
 /* br_device.c */
-void br_dev_setup(struct net_device *dev);
+extern void br_dev_setup(struct net_device *dev);
 
 /* br_fdb.c */
-void br_fdb_changeaddr(struct net_bridge_port *p,
+extern void br_fdb_changeaddr(struct net_bridge_port *p,
 		       unsigned char *newaddr);
-void br_fdb_cleanup(struct net_bridge *br);
-void br_fdb_delete_by_port(struct net_bridge *br,
+extern void br_fdb_cleanup(struct net_bridge *br);
+extern void br_fdb_delete_by_port(struct net_bridge *br,
 			   struct net_bridge_port *p);
-struct net_bridge_fdb_entry *br_fdb_get(struct net_bridge *br,
+extern struct net_bridge_fdb_entry *br_fdb_get(struct net_bridge *br,
 					unsigned char *addr);
-void br_fdb_put(struct net_bridge_fdb_entry *ent);
-int  br_fdb_get_entries(struct net_bridge *br,
+extern void br_fdb_put(struct net_bridge_fdb_entry *ent);
+extern int  br_fdb_get_entries(struct net_bridge *br,
 			unsigned char *_buf,
 			int maxnum,
 			int offset);
-void br_fdb_insert(struct net_bridge *br,
+extern void br_fdb_insert(struct net_bridge *br,
 		   struct net_bridge_port *source,
 		   unsigned char *addr,
 		   int is_local);
 
 /* br_forward.c */
-void br_forward(struct net_bridge_port *to,
+extern void br_forward(struct net_bridge_port *to,
 		struct sk_buff *skb);
-void br_flood(struct net_bridge *br,
+extern void br_flood(struct net_bridge *br,
 	      struct sk_buff *skb,
 	      int clone);
 
 /* br_if.c */
-int br_add_bridge(char *name);
-int br_del_bridge(char *name);
-int br_add_if(struct net_bridge *br,
+extern int br_add_bridge(char *name);
+extern int br_del_bridge(char *name);
+extern int br_add_if(struct net_bridge *br,
 	      struct net_device *dev);
-int br_del_if(struct net_bridge *br,
+extern int br_del_if(struct net_bridge *br,
 	      struct net_device *dev);
-int br_get_bridge_ifindices(int *indices,
+extern int br_get_bridge_ifindices(int *indices,
 			    int num);
-void br_get_port_ifindices(struct net_bridge *br,
+extern void br_get_port_ifindices(struct net_bridge *br,
 			   int *ifindices);
 
 /* br_input.c */
-void br_handle_frame(struct sk_buff *skb);
+extern void br_handle_frame(struct sk_buff *skb);
 
 /* br_ioctl.c */
-void br_call_ioctl_atomic(void (*fn)(void));
-int br_ioctl(struct net_bridge *br,
+extern void br_call_ioctl_atomic(void (*fn)(void));
+extern int br_ioctl(struct net_bridge *br,
 	     unsigned int cmd,
 	     unsigned long arg0,
 	     unsigned long arg1,
 	     unsigned long arg2);
-int br_ioctl_deviceless_stub(unsigned long arg);
+extern int br_ioctl_deviceless_stub(unsigned long arg);
 
 /* br_stp.c */
-int br_is_root_bridge(struct net_bridge *br);
-struct net_bridge_port *br_get_port(struct net_bridge *br,
+extern int br_is_root_bridge(struct net_bridge *br);
+extern struct net_bridge_port *br_get_port(struct net_bridge *br,
 				    int port_no);
-void br_init_port(struct net_bridge_port *p);
-port_id br_make_port_id(struct net_bridge_port *p);
-void br_become_designated_port(struct net_bridge_port *p);
+extern void br_init_port(struct net_bridge_port *p);
+extern port_id br_make_port_id(struct net_bridge_port *p);
+extern void br_become_designated_port(struct net_bridge_port *p);
 
 /* br_stp_if.c */
-void br_stp_enable_bridge(struct net_bridge *br);
-void br_stp_disable_bridge(struct net_bridge *br);
-void br_stp_enable_port(struct net_bridge_port *p);
-void br_stp_disable_port(struct net_bridge_port *p);
-void br_stp_recalculate_bridge_id(struct net_bridge *br);
-void br_stp_set_bridge_priority(struct net_bridge *br,
+extern void br_stp_enable_bridge(struct net_bridge *br);
+extern void br_stp_disable_bridge(struct net_bridge *br);
+extern void br_stp_enable_port(struct net_bridge_port *p);
+extern void br_stp_disable_port(struct net_bridge_port *p);
+extern void br_stp_recalculate_bridge_id(struct net_bridge *br);
+extern void br_stp_set_bridge_priority(struct net_bridge *br,
 				int newprio);
-void br_stp_set_port_priority(struct net_bridge_port *p,
+extern void br_stp_set_port_priority(struct net_bridge_port *p,
 			      int newprio);
-void br_stp_set_path_cost(struct net_bridge_port *p,
+extern void br_stp_set_path_cost(struct net_bridge_port *p,
 			  int path_cost);
 
 /* br_stp_bpdu.c */
-void br_stp_handle_bpdu(struct sk_buff *skb);
+extern void br_stp_handle_bpdu(struct sk_buff *skb);
 
 #endif
diff -urN linux-2.4.2-pre2/net/bridge/br_private_stp.h linux/net/bridge/br_private_stp.h
--- linux-2.4.2-pre2/net/bridge/br_private_stp.h	Mon Oct 30 14:34:12 2000
+++ linux/net/bridge/br_private_stp.h	Mon Dec  3 22:28:21 2001
@@ -4,7 +4,7 @@
  *	Authors:
  *	Lennert Buytenhek		<buytenh@gnu.org>
  *
- *	$Id: br_private_stp.h,v 1.2 2000/10/30 22:03:20 davem Exp $
+ *	$Id: br_private_stp.h,v 1.3 2001/02/05 06:03:47 davem Exp $
  *
  *	This program is free software; you can redistribute it and/or
  *	modify it under the terms of the GNU General Public License
@@ -33,21 +33,21 @@
 };
 
 /* br_stp.c */
-void br_become_root_bridge(struct net_bridge *br);
-void br_config_bpdu_generation(struct net_bridge *);
-void br_configuration_update(struct net_bridge *);
-int  br_is_designated_port(struct net_bridge_port *p);
-int  br_is_root_bridge(struct net_bridge *br);
-void br_port_state_selection(struct net_bridge *);
-void br_received_config_bpdu(struct net_bridge_port *p, struct br_config_bpdu *bpdu);
-void br_received_tcn_bpdu(struct net_bridge_port *p);
-void br_tick(unsigned long __data);
-void br_transmit_config(struct net_bridge_port *p);
-void br_transmit_tcn(struct net_bridge *br);
-void br_topology_change_detection(struct net_bridge *br);
+extern void br_become_root_bridge(struct net_bridge *br);
+extern void br_config_bpdu_generation(struct net_bridge *);
+extern void br_configuration_update(struct net_bridge *);
+extern int  br_is_designated_port(struct net_bridge_port *p);
+extern int  br_is_root_bridge(struct net_bridge *br);
+extern void br_port_state_selection(struct net_bridge *);
+extern void br_received_config_bpdu(struct net_bridge_port *p, struct br_config_bpdu *bpdu);
+extern void br_received_tcn_bpdu(struct net_bridge_port *p);
+extern void br_tick(unsigned long __data);
+extern void br_transmit_config(struct net_bridge_port *p);
+extern void br_transmit_tcn(struct net_bridge *br);
+extern void br_topology_change_detection(struct net_bridge *br);
 
 /* br_stp_bpdu.c */
-void br_send_config_bpdu(struct net_bridge_port *, struct br_config_bpdu *);
-void br_send_tcn_bpdu(struct net_bridge_port *);
+extern void br_send_config_bpdu(struct net_bridge_port *, struct br_config_bpdu *);
+extern void br_send_tcn_bpdu(struct net_bridge_port *);
 
 #endif
diff -urN linux-2.4.2-pre2/net/core/iovec.c linux/net/core/iovec.c
--- linux-2.4.2-pre2/net/core/iovec.c	Sat Jan 22 11:54:57 2000
+++ linux/net/core/iovec.c	Mon Dec  3 22:28:21 2001
@@ -21,7 +21,7 @@
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/net.h>
 #include <linux/in6.h>
 #include <asm/uaccess.h>
diff -urN linux-2.4.2-pre2/net/core/skbuff.c linux/net/core/skbuff.c
--- linux-2.4.2-pre2/net/core/skbuff.c	Fri Dec 29 14:07:24 2000
+++ linux/net/core/skbuff.c	Mon Dec  3 22:28:21 2001
@@ -44,7 +44,7 @@
 #include <linux/interrupt.h>
 #include <linux/in.h>
 #include <linux/inet.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/netdevice.h>
 #include <linux/string.h>
 #include <linux/skbuff.h>
diff -urN linux-2.4.2-pre2/net/decnet/af_decnet.c linux/net/decnet/af_decnet.c
--- linux-2.4.2-pre2/net/decnet/af_decnet.c	Mon Jan 29 08:07:30 2001
+++ linux/net/decnet/af_decnet.c	Mon Dec  3 22:28:21 2001
@@ -114,6 +114,7 @@
 #include <net/sock.h>
 #include <asm/segment.h>
 #include <asm/system.h>
+#include <asm/ioctls.h>
 #include <linux/mm.h>
 #include <linux/interrupt.h>
 #include <linux/proc_fs.h>
diff -urN linux-2.4.2-pre2/net/decnet/sysctl_net_decnet.c linux/net/decnet/sysctl_net_decnet.c
--- linux-2.4.2-pre2/net/decnet/sysctl_net_decnet.c	Sun Nov 12 20:37:17 2000
+++ linux/net/decnet/sysctl_net_decnet.c	Mon Dec  3 22:28:21 2001
@@ -127,7 +127,7 @@
 				void *newval, size_t newlen,
 				void **context)
 {
-	int len;
+	size_t len;
 	dn_address addr;
 
 	if (oldval && oldlenp) {
@@ -161,7 +161,7 @@
 				void *buffer, size_t *lenp)
 {
 	char addr[DN_ASCBUF_LEN];
-	int len;
+	size_t len;
 	dn_address dnaddr;
 
 	if (!*lenp || (filp->f_pos && !write)) {
@@ -265,7 +265,7 @@
 				struct file * filp,
 				void *buffer, size_t *lenp)
 {
-	int len;
+	size_t len;
 	struct net_device *dev = decnet_default_device;
 	char devname[17];
 
diff -urN linux-2.4.2-pre2/net/ipv4/arp.c linux/net/ipv4/arp.c
--- linux-2.4.2-pre2/net/ipv4/arp.c	Mon Jan  1 10:23:21 2001
+++ linux/net/ipv4/arp.c	Mon Dec  3 22:28:21 2001
@@ -65,19 +65,9 @@
  *					clean up the APFDDI & gen. FDDI bits.
  *		Alexey Kuznetsov:	new arp state machine;
  *					now it is in net/core/neighbour.c.
+ *		Krzysztof Halasa:	Added Frame Relay ARP support.
  */
 
-/* RFC1122 Status:
-   2.3.2.1 (ARP Cache Validation):
-     MUST provide mechanism to flush stale cache entries (OK)
-     SHOULD be able to configure cache timeout (OK)
-     MUST throttle ARP retransmits (OK)
-   2.3.2.2 (ARP Packet Queue):
-     SHOULD save at least one packet from each "conversation" with an
-       unresolved IP address.  (OK)
-   950727 -- MS
-*/
-      
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/kernel.h>
@@ -647,6 +637,20 @@
 			goto out;
 		break;
 #endif
+#ifdef CONFIG_NET_FC
+	case ARPHRD_IEEE802:
+		/*
+		 * According to RFC 2625, Fibre Channel devices (which are IEEE
+		 * 802 devices) should accept ARP hardware types of 6 (IEEE 802)
+		 * and 1 (Ethernet).
+		 */
+		if (arp->ar_hrd != __constant_htons(ARPHRD_ETHER) &&
+		    arp->ar_hrd != __constant_htons(ARPHRD_IEEE802))
+			goto out;
+		if (arp->ar_pro != __constant_htons(ETH_P_IP))
+			goto out;
+		break;
+#endif
 #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
 	case ARPHRD_AX25:
 		if (arp->ar_pro != __constant_htons(AX25_P_IP))
@@ -687,6 +691,12 @@
  */
 	if (LOOPBACK(tip) || MULTICAST(tip))
 		goto out;
+
+/*
+ *     Special case: We must set Frame Relay source Q.922 address
+ */
+	if (dev_type == ARPHRD_DLCI)
+		sha = dev->broadcast;
 
 /*
  *  Process entry.  The idea here is we want to send a reply if it is a
diff -urN linux-2.4.2-pre2/net/ipv4/devinet.c linux/net/ipv4/devinet.c
--- linux-2.4.2-pre2/net/ipv4/devinet.c	Mon Dec 11 12:37:04 2000
+++ linux/net/ipv4/devinet.c	Mon Dec  3 22:28:21 2001
@@ -1,7 +1,7 @@
 /*
  *	NET3	IP device support routines.
  *
- *	Version: $Id: devinet.c,v 1.39 2000/12/10 22:24:11 davem Exp $
+ *	Version: $Id: devinet.c,v 1.40 2001/02/05 06:03:47 davem Exp $
  *
  *		This program is free software; you can redistribute it and/or
  *		modify it under the terms of the GNU General Public License
@@ -50,9 +50,7 @@
 #ifdef CONFIG_SYSCTL
 #include <linux/sysctl.h>
 #endif
-#ifdef CONFIG_KMOD
 #include <linux/kmod.h>
-#endif
 
 #include <net/ip.h>
 #include <net/route.h>
diff -urN linux-2.4.2-pre2/net/ipv4/ipconfig.c linux/net/ipv4/ipconfig.c
--- linux-2.4.2-pre2/net/ipv4/ipconfig.c	Fri Dec 29 14:35:47 2000
+++ linux/net/ipv4/ipconfig.c	Mon Dec  3 22:28:21 2001
@@ -1,5 +1,5 @@
 /*
- *  $Id: ipconfig.c,v 1.34 2000/07/26 01:04:18 davem Exp $
+ *  $Id: ipconfig.c,v 1.35 2000/12/30 06:46:36 davem Exp $
  *
  *  Automatic Configuration of IP -- use BOOTP or RARP or user-supplied
  *  information to configure own IP address and routes.
diff -urN linux-2.4.2-pre2/net/ipv4/netfilter/ip_fw_compat.c linux/net/ipv4/netfilter/ip_fw_compat.c
--- linux-2.4.2-pre2/net/ipv4/netfilter/ip_fw_compat.c	Mon Dec  3 22:28:13 2001
+++ linux/net/ipv4/netfilter/ip_fw_compat.c	Mon Dec  3 22:28:21 2001
@@ -9,6 +9,7 @@
 #include <linux/inetdevice.h>
 #include <linux/netdevice.h>
 #include <linux/module.h>
+#include <asm/uaccess.h>
 #include <net/ip.h>
 #include <net/route.h>
 #include <linux/netfilter_ipv4/compat_firewall.h>
@@ -197,14 +198,28 @@
 	return NF_ACCEPT;
 }
 
-extern int ip_fw_ctl(int optval, void *user, unsigned int len);
+extern int ip_fw_ctl(int optval, void *m, unsigned int len);
 
 static int sock_fn(struct sock *sk, int optval, void *user, unsigned int len)
 {
+	/* MAX of:
+	   2.2: sizeof(struct ip_fwtest) (~14x4 + 3x4 = 17x4)
+	   2.2: sizeof(struct ip_fwnew) (~1x4 + 15x4 + 3x4 + 3x4 = 22x4)
+	   2.0: sizeof(struct ip_fw) (~25x4)
+
+	   We can't include both 2.0 and 2.2 headers, they conflict.
+	   Hence, 200 is a good number. --RR */
+	char tmp_fw[200];
 	if (!capable(CAP_NET_ADMIN))
 		return -EPERM;
 
-	return -ip_fw_ctl(optval, user, len);
+	if (len > sizeof(tmp_fw) || len < 1)
+		return -EINVAL;
+
+	if (copy_from_user(&tmp_fw, user, len))
+		return -EFAULT;
+
+	return -ip_fw_ctl(optval, &tmp_fw, len);
 }
 
 static struct nf_hook_ops preroute_ops
diff -urN linux-2.4.2-pre2/net/ipv4/netfilter/ipt_TOS.c linux/net/ipv4/netfilter/ipt_TOS.c
--- linux-2.4.2-pre2/net/ipv4/netfilter/ipt_TOS.c	Thu Apr 27 15:43:15 2000
+++ linux/net/ipv4/netfilter/ipt_TOS.c	Mon Dec  3 22:28:21 2001
@@ -19,11 +19,11 @@
 	const struct ipt_tos_target_info *tosinfo = targinfo;
 
 	if ((iph->tos & IPTOS_TOS_MASK) != tosinfo->tos) {
-		u_int8_t diffs[2];
+		u_int16_t diffs[2];
 
-		diffs[0] = iph->tos;
+		diffs[0] = htons(iph->tos) ^ 0xFFFF;
 		iph->tos = (iph->tos & IPTOS_PREC_MASK) | tosinfo->tos;
-		diffs[1] = iph->tos;
+		diffs[1] = htons(iph->tos);
 		iph->check = csum_fold(csum_partial((char *)diffs,
 		                                    sizeof(diffs),
 		                                    iph->check^0xFFFF));
diff -urN linux-2.4.2-pre2/net/ipv4/raw.c linux/net/ipv4/raw.c
--- linux-2.4.2-pre2/net/ipv4/raw.c	Tue Nov 28 21:53:45 2000
+++ linux/net/ipv4/raw.c	Mon Dec  3 22:28:21 2001
@@ -41,6 +41,7 @@
 #include <linux/config.h> 
 #include <asm/system.h>
 #include <asm/uaccess.h>
+#include <asm/ioctls.h>
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
diff -urN linux-2.4.2-pre2/net/ipv4/syncookies.c linux/net/ipv4/syncookies.c
--- linux-2.4.2-pre2/net/ipv4/syncookies.c	Fri Aug  4 18:18:49 2000
+++ linux/net/ipv4/syncookies.c	Mon Dec  3 22:28:21 2001
@@ -17,7 +17,7 @@
 #include <linux/config.h>
 #if defined(CONFIG_SYN_COOKIES) 
 #include <linux/tcp.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/random.h>
 #include <net/tcp.h>
 
diff -urN linux-2.4.2-pre2/net/ipv4/tcp.c linux/net/ipv4/tcp.c
--- linux-2.4.2-pre2/net/ipv4/tcp.c	Wed Jan 10 14:12:12 2001
+++ linux/net/ipv4/tcp.c	Mon Dec  3 22:28:21 2001
@@ -245,175 +245,6 @@
  *	TCP_CLOSE		socket is finished
  */
 
-/*
- * RFC1122 status:
- * NOTE: I'm not going to be doing comments in the code for this one except
- * for violations and the like.  tcp.c is just too big... If I say something
- * "does?" or "doesn't?", it means I'm not sure, and will have to hash it out
- * with Alan. -- MS 950903
- * [Note: Most of the TCP code has been rewriten/redesigned since this 
- *  RFC1122 check. It is probably not correct anymore. It should be redone 
- *  before 2.2. -AK]
- *
- * Use of PSH (4.2.2.2)
- *   MAY aggregate data sent without the PSH flag. (does)
- *   MAY queue data received without the PSH flag. (does)
- *   SHOULD collapse successive PSH flags when it packetizes data. (doesn't)
- *   MAY implement PSH on send calls. (doesn't, thus:)
- *     MUST NOT buffer data indefinitely (doesn't [1 second])
- *     MUST set PSH on last segment (does)
- *   MAY pass received PSH to application layer (doesn't)
- *   SHOULD send maximum-sized segment whenever possible. (almost always does)
- *
- * Window Size (4.2.2.3, 4.2.2.16)
- *   MUST treat window size as an unsigned number (does)
- *   SHOULD treat window size as a 32-bit number (does not)
- *   MUST NOT shrink window once it is offered (does not normally)
- *
- * Urgent Pointer (4.2.2.4)
- * **MUST point urgent pointer to last byte of urgent data (not right
- *     after). (doesn't, to be like BSD. That's configurable, but defaults
- *	to off)
- *   MUST inform application layer asynchronously of incoming urgent
- *     data. (does)
- *   MUST provide application with means of determining the amount of
- *     urgent data pending. (does)
- * **MUST support urgent data sequence of arbitrary length. (doesn't, but
- *   it's sort of tricky to fix, as urg_ptr is a 16-bit quantity)
- *	[Follows BSD 1 byte of urgent data]
- *
- * TCP Options (4.2.2.5)
- *   MUST be able to receive TCP options in any segment. (does)
- *   MUST ignore unsupported options (does)
- *
- * Maximum Segment Size Option (4.2.2.6)
- *   MUST implement both sending and receiving MSS. (does, but currently
- *	only uses the smaller of both of them)
- *   SHOULD send an MSS with every SYN where receive MSS != 536 (MAY send
- *     it always). (does, even when MSS == 536, which is legal)
- *   MUST assume MSS == 536 if no MSS received at connection setup (does)
- *   MUST calculate "effective send MSS" correctly:
- *     min(physical_MTU, remote_MSS+20) - sizeof(tcphdr) - sizeof(ipopts)
- *     (does - but allows operator override)
- *
- * TCP Checksum (4.2.2.7)
- *   MUST generate and check TCP checksum. (does)
- *
- * Initial Sequence Number Selection (4.2.2.8)
- *   MUST use the RFC 793 clock selection mechanism.  (doesn't, but it's
- *     OK: RFC 793 specifies a 250KHz clock, while we use 1MHz, which is
- *     necessary for 10Mbps networks - and harder than BSD to spoof!
- *     With syncookies we don't)
- *
- * Simultaneous Open Attempts (4.2.2.10)
- *   MUST support simultaneous open attempts (does)
- *
- * Recovery from Old Duplicate SYN (4.2.2.11)
- *   MUST keep track of active vs. passive open (does)
- *
- * RST segment (4.2.2.12)
- *   SHOULD allow an RST segment to contain data (does, but doesn't do
- *     anything with it, which is standard)
- *
- * Closing a Connection (4.2.2.13)
- *   MUST inform application of whether connection was closed by RST or
- *     normal close. (does)
- *   MAY allow "half-duplex" close (treat connection as closed for the
- *     local app, even before handshake is done). (does)
- *   MUST linger in TIME_WAIT for 2 * MSL (does)
- *
- * Retransmission Timeout (4.2.2.15)
- *   MUST implement Jacobson's slow start and congestion avoidance
- *     stuff. (does)
- *
- * Probing Zero Windows (4.2.2.17)
- *   MUST support probing of zero windows. (does)
- *   MAY keep offered window closed indefinitely. (does)
- *   MUST allow remote window to stay closed indefinitely. (does)
- *
- * Passive Open Calls (4.2.2.18)
- *   MUST NOT let new passive open affect other connections. (doesn't)
- *   MUST support passive opens (LISTENs) concurrently. (does)
- *
- * Time to Live (4.2.2.19)
- *   MUST make TCP TTL configurable. (does - IP_TTL option)
- *
- * Event Processing (4.2.2.20)
- *   SHOULD queue out-of-order segments. (does)
- *   MUST aggregate ACK segments whenever possible. (does but badly)
- *
- * Retransmission Timeout Calculation (4.2.3.1)
- *   MUST implement Karn's algorithm and Jacobson's algorithm for RTO
- *     calculation. (does, or at least explains them in the comments 8*b)
- *  SHOULD initialize RTO to 0 and RTT to 3. (does)
- *
- * When to Send an ACK Segment (4.2.3.2)
- *   SHOULD implement delayed ACK. (does)
- *   MUST keep ACK delay < 0.5 sec. (does)
- *
- * When to Send a Window Update (4.2.3.3)
- *   MUST implement receiver-side SWS. (does)
- *
- * When to Send Data (4.2.3.4)
- *   MUST implement sender-side SWS. (does)
- *   SHOULD implement Nagle algorithm. (does)
- *
- * TCP Connection Failures (4.2.3.5)
- *  MUST handle excessive retransmissions "properly" (see the RFC). (does)
- *   SHOULD inform application layer of soft errors. (does)
- *
- * TCP Keep-Alives (4.2.3.6)
- *   MAY provide keep-alives. (does)
- *   MUST make keep-alives configurable on a per-connection basis. (does)
- *   MUST default to no keep-alives. (does)
- *   MUST make keep-alive interval configurable. (does)
- *   MUST make default keep-alive interval > 2 hours. (does)
- *   MUST NOT interpret failure to ACK keep-alive packet as dead
- *     connection. (doesn't)
- *   SHOULD send keep-alive with no data. (does)
- *
- * TCP Multihoming (4.2.3.7)
- *   MUST get source address from IP layer before sending first
- *     SYN. (does)
- *   MUST use same local address for all segments of a connection. (does)
- *
- * IP Options (4.2.3.8)
- *   MUST ignore unsupported IP options. (does)
- *   MAY support Time Stamp and Record Route. (does)
- *   MUST allow application to specify a source route. (does)
- *   MUST allow received Source Route option to set route for all future
- *     segments on this connection. (does not (security issues))
- *
- * ICMP messages (4.2.3.9)
- *   MUST act on ICMP errors. (does)
- *   MUST slow transmission upon receipt of a Source Quench. (doesn't anymore 
- *   because that is deprecated now by the IETF, can be turned on)
- *   MUST NOT abort connection upon receipt of soft Destination
- *     Unreachables (0, 1, 5), Time Exceededs and Parameter
- *     Problems. (doesn't)
- *   SHOULD report soft Destination Unreachables etc. to the
- *     application. (does, except during SYN_RECV and may drop messages
- *     in some rare cases before accept() - ICMP is unreliable)	
- *   SHOULD abort connection upon receipt of hard Destination Unreachable
- *     messages (2, 3, 4). (does, but see above)
- *
- * Remote Address Validation (4.2.3.10)
- *   MUST reject as an error OPEN for invalid remote IP address. (does)
- *   MUST ignore SYN with invalid source address. (does)
- *   MUST silently discard incoming SYN for broadcast/multicast
- *     address. (does)
- *
- * Asynchronous Reports (4.2.4.1)
- * MUST provide mechanism for reporting soft errors to application
- *     layer. (does)
- *
- * Type of Service (4.2.4.2)
- *   MUST allow application layer to set Type of Service. (does IP_TOS)
- *
- * (Whew. -- MS 950903)
- * (Updated by AK, but not complete yet.)
- **/
-
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/fcntl.h>
@@ -425,6 +256,7 @@
 #include <net/tcp.h>
 
 #include <asm/uaccess.h>
+#include <asm/ioctls.h>
 
 int sysctl_tcp_fin_timeout = TCP_FIN_TIMEOUT;
 
diff -urN linux-2.4.2-pre2/net/ipv4/tcp_input.c linux/net/ipv4/tcp_input.c
--- linux-2.4.2-pre2/net/ipv4/tcp_input.c	Wed Jan 10 14:12:12 2001
+++ linux/net/ipv4/tcp_input.c	Mon Dec  3 22:28:21 2001
@@ -600,7 +600,7 @@
 /* Increase initial CWND conservatively: if estimated
  * RTT is low enough (<20msec) or if we have some preset ssthresh.
  *
- * Numbers are taken from RFC1414.
+ * Numbers are taken from RFC2414.
  */
 __u32 tcp_init_cwnd(struct tcp_opt *tp)
 {
@@ -2164,43 +2164,23 @@
 		!tcp_disordered_ack(tp, skb));
 }
 
-static int __tcp_sequence(struct tcp_opt *tp, u32 seq, u32 end_seq)
-{
-	u32 end_window = tp->rcv_wup + tp->rcv_wnd;
-#ifdef TCP_FORMAL_WINDOW
-	u32 rcv_wnd = tcp_receive_window(tp);
-#else
-	u32 rcv_wnd = tp->rcv_wnd;
-#endif
-
-	if (rcv_wnd &&
-	    after(end_seq, tp->rcv_nxt) &&
-	    before(seq, end_window))
-		return 1;
-	if (seq != end_window)
-		return 0;
-	return (seq == end_seq);
-}
-
-/* This functions checks to see if the tcp header is actually acceptable.
+/* Check segment sequence number for validity.
+ *
+ * Segment controls are considered valid, if the segment
+ * fits to the window after truncation to the window. Acceptability
+ * of data (and SYN, FIN, of course) is checked separately.
+ * See tcp_data_queue(), for example.
  *
- * Actually, our check is seriously broken, we must accept RST,ACK,URG
- * even on zero window effectively trimming data. It is RFC, guys.
- * But our check is so beautiful, that I do not want to repair it
- * now. However, taking into account those stupid plans to start to
- * send some texts with RST, we have to handle at least this case. --ANK
+ * Also, controls (RST is main one) are accepted using RCV.WUP instead
+ * of RCV.NXT. Peer still did not advance his SND.UNA when we
+ * delayed ACK, so that hisSND.UNA<=ourRCV.WUP.
+ * (borrowed from freebsd)
  */
-extern __inline__ int tcp_sequence(struct tcp_opt *tp, u32 seq, u32 end_seq, int rst)
-{
-#ifdef TCP_FORMAL_WINDOW
-	u32 rcv_wnd = tcp_receive_window(tp);
-#else
-	u32 rcv_wnd = tp->rcv_wnd;
-#endif
-	if (seq == tp->rcv_nxt)
-		return (rcv_wnd || (end_seq == seq) || rst);
 
-	return __tcp_sequence(tp, seq, end_seq);
+static inline int tcp_sequence(struct tcp_opt *tp, u32 seq, u32 end_seq)
+{
+	return	!before(end_seq, tp->rcv_wup) &&
+		!after(seq, tp->rcv_nxt + tcp_receive_window(tp));
 }
 
 /* When we get a reset we do this. */
@@ -2541,7 +2521,10 @@
 	 *  Out of sequence packets to the out_of_order_queue.
 	 */
 	if (TCP_SKB_CB(skb)->seq == tp->rcv_nxt) {
-		/* Ok. In sequence. */
+		if (tcp_receive_window(tp) == 0)
+			goto out_of_window;
+
+		/* Ok. In sequence. In window. */
 		if (tp->ucopy.task == current &&
 		    tp->copied_seq == tp->rcv_nxt &&
 		    tp->ucopy.len &&
@@ -2601,20 +2584,27 @@
 		return;
 	}
 
-#ifdef TCP_DEBUG
-	/* An old packet, either a retransmit or some packet got lost. */
 	if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) {
-		/* A retransmit, 2nd most common case.  Force an imediate ack.
-		 * 
-		 * It is impossible, seq is checked by top level.
-		 */
-		printk("BUG: retransmit in tcp_data_queue: seq %X\n", TCP_SKB_CB(skb)->seq);
+		/* A retransmit, 2nd most common case.  Force an immediate ack. */
+		NET_INC_STATS_BH(DelayedACKLost);
 		tcp_enter_quickack_mode(tp);
+		tcp_dsack_set(tp, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq);
+
+out_of_window:
 		tcp_schedule_ack(tp);
 		__kfree_skb(skb);
 		return;
 	}
-#endif
+
+	/* Out of window. F.e. zero window probe.
+	 *
+	 * Note: it is highly possible that we may open window and enqueue
+	 * this segment now. However, this will be known only after we queue
+	 * it, which will result in queue full of successive 1 byte BSD
+	 * window probes, it is SWS in fact. So, always reject it and send ACK.
+	 */
+	if (!before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt+tcp_receive_window(tp)))
+		goto out_of_window;
 
 	tcp_enter_quickack_mode(tp);
 
@@ -2625,6 +2615,12 @@
 			   TCP_SKB_CB(skb)->end_seq);
 
 		tcp_dsack_set(tp, TCP_SKB_CB(skb)->seq, tp->rcv_nxt);
+		
+		/* If window is closed, drop tail of packet. But after
+		 * remembering D-SACK for its head made in previous line.
+		 */
+		if (!tcp_receive_window(tp))
+			goto out_of_window;
 		goto queue_and_out;
 	}
 
@@ -3333,7 +3329,7 @@
 	 *	Standard slow path.
 	 */
 
-	if (!tcp_sequence(tp, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq, th->rst)) {
+	if (!tcp_sequence(tp, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq)) {
 		/* RFC793, page 37: "In all states except SYN-SENT, all reset
 		 * (RST) segments are validated by checking their SEQ-fields."
 		 * And page 69: "If an incoming segment is not acceptable,
@@ -3669,7 +3665,7 @@
 	}
 
 	/* step 1: check sequence number */
-	if (!tcp_sequence(tp, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq, th->rst)) {
+	if (!tcp_sequence(tp, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq)) {
 		if (!th->rst)
 			tcp_send_dupack(sk, skb);
 		goto discard;
diff -urN linux-2.4.2-pre2/net/ipv4/tcp_timer.c linux/net/ipv4/tcp_timer.c
--- linux-2.4.2-pre2/net/ipv4/tcp_timer.c	Mon Jan  1 11:01:58 2001
+++ linux/net/ipv4/tcp_timer.c	Mon Dec  3 22:28:21 2001
@@ -5,7 +5,7 @@
  *
  *		Implementation of the Transmission Control Protocol(TCP).
  *
- * Version:	$Id: tcp_timer.c,v 1.80 2000/10/03 07:29:01 anton Exp $
+ * Version:	$Id: tcp_timer.c,v 1.81 2001/01/01 02:38:30 davem Exp $
  *
  * Authors:	Ross Biro, <bir7@leland.Stanford.Edu>
  *		Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
diff -urN linux-2.4.2-pre2/net/ipv4/udp.c linux/net/ipv4/udp.c
--- linux-2.4.2-pre2/net/ipv4/udp.c	Mon Jan  1 11:01:58 2001
+++ linux/net/ipv4/udp.c	Mon Dec  3 22:28:21 2001
@@ -69,31 +69,9 @@
  *		2 of the License, or (at your option) any later version.
  */
  
-/* RFC1122 Status:
-   4.1.3.1 (Ports):
-     SHOULD send ICMP_PORT_UNREACHABLE in response to datagrams to 
-       an un-listened port. (OK)
-   4.1.3.2 (IP Options)
-     MUST pass IP options from IP -> application (OK)
-     MUST allow application to specify IP options (OK)
-   4.1.3.3 (ICMP Messages)
-     MUST pass ICMP error messages to application (OK -- except when SO_BSDCOMPAT is set)
-   4.1.3.4 (UDP Checksums)
-     MUST provide facility for checksumming (OK)
-     MAY allow application to control checksumming (OK)
-     MUST default to checksumming on (OK)
-     MUST discard silently datagrams with bad csums (OK, except during debugging)
-   4.1.3.5 (UDP Multihoming)
-     MUST allow application to specify source address (OK)
-     SHOULD be able to communicate the chosen src addr up to application
-       when application doesn't choose (DOES - use recvmsg cmsgs)
-   4.1.3.6 (Invalid Addresses)
-     MUST discard invalid source addresses (OK -- done in the new routing code)
-     MUST only send datagrams with one of our addresses (OK)
-*/
-
 #include <asm/system.h>
 #include <asm/uaccess.h>
+#include <asm/ioctls.h>
 #include <linux/types.h>
 #include <linux/fcntl.h>
 #include <linux/socket.h>
@@ -161,7 +139,7 @@
 		next:;
 		}
 		result = best;
-		for(;; result += UDP_HTABLE_SIZE) {
+		for(i = 0; i < (1 << 16) / UDP_HTABLE_SIZE; i++, result += UDP_HTABLE_SIZE) {
 			if (result > sysctl_local_port_range[1])
 				result = sysctl_local_port_range[0]
 					+ ((result - sysctl_local_port_range[0]) &
@@ -169,6 +147,8 @@
 			if (!udp_lport_inuse(result))
 				break;
 		}
+		if (i >= (1 << 16) / UDP_HTABLE_SIZE)
+			goto fail;
 gotit:
 		udp_port_rover = snum = result;
 	} else {
diff -urN linux-2.4.2-pre2/net/ipv6/addrconf.c linux/net/ipv6/addrconf.c
--- linux-2.4.2-pre2/net/ipv6/addrconf.c	Mon Jan  1 11:01:58 2001
+++ linux/net/ipv6/addrconf.c	Mon Dec  3 22:28:21 2001
@@ -6,7 +6,7 @@
  *	Pedro Roque		<roque@di.fc.ul.pt>	
  *	Alexey Kuznetsov	<kuznet@ms2.inr.ac.ru>
  *
- *	$Id: addrconf.c,v 1.59 2000/11/28 11:39:43 davem Exp $
+ *	$Id: addrconf.c,v 1.60 2001/01/01 02:38:30 davem Exp $
  *
  *	This program is free software; you can redistribute it and/or
  *      modify it under the terms of the GNU General Public License
diff -urN linux-2.4.2-pre2/net/ipv6/raw.c linux/net/ipv6/raw.c
--- linux-2.4.2-pre2/net/ipv6/raw.c	Tue Nov 28 21:53:45 2000
+++ linux/net/ipv6/raw.c	Mon Dec  3 22:28:21 2001
@@ -29,6 +29,7 @@
 #include <linux/if_arp.h>
 #include <linux/icmpv6.h>
 #include <asm/uaccess.h>
+#include <asm/ioctls.h>
 
 #include <net/sock.h>
 #include <net/snmp.h>
diff -urN linux-2.4.2-pre2/net/ipx/af_ipx.c linux/net/ipx/af_ipx.c
--- linux-2.4.2-pre2/net/ipx/af_ipx.c	Mon Jan 22 13:32:10 2001
+++ linux/net/ipx/af_ipx.c	Mon Dec  3 22:28:21 2001
@@ -64,6 +64,7 @@
  *	Revision 043:	Shared SKBs, don't mangle packets, some cleanups
  *			Arnaldo Carvalho de Melo <acme@conectiva.com.br>,
  *			December, 2000
+ *	Revision 044:	Call ipxitf_hold on NETDEV_UP (acme)
  *
  *	Protect the module by a MOD_INC_USE_COUNT/MOD_DEC_USE_COUNT
  *	pair. Also, now usage count is managed this way
@@ -443,19 +444,21 @@
 	struct net_device *dev = ptr;
 	ipx_interface *i, *tmp;
 
-	if (event != NETDEV_DOWN)
-		return NOTIFY_DONE;
+	if (event != NETDEV_DOWN && event != NETDEV_UP)
+		goto out;
 
 	spin_lock_bh(&ipx_interfaces_lock);
 	for (i = ipx_interfaces; i;) {
 		tmp = i->if_next;
 		if (i->if_dev == dev)
-			__ipxitf_put(i);
+			if (event == NETDEV_UP)
+				ipxitf_hold(i);
+			else
+				__ipxitf_put(i);
 		i = tmp;
-
 	}
 	spin_unlock_bh(&ipx_interfaces_lock);
-	return NOTIFY_DONE;
+out:	return NOTIFY_DONE;
 }
 
 static void ipxitf_def_skb_handler(struct sock *sock, struct sk_buff *skb)
@@ -1067,7 +1070,7 @@
 		intrfc->if_sklist 	= NULL;
 		intrfc->if_sknum 	= IPX_MIN_EPHEMERAL_SOCKET;
 		/* Setup primary if necessary */
-		if ((idef->ipx_special == IPX_PRIMARY))
+		if (idef->ipx_special == IPX_PRIMARY)
 			ipx_primary_net = intrfc;
 		intrfc->if_internal 	= 0;
 		intrfc->if_ipx_offset 	= dev->hard_header_len + datalink->header_length;
@@ -2407,8 +2410,8 @@
  */
 
 static struct net_proto_family ipx_family_ops = {
-	PF_IPX,
-	ipx_create
+	family:		PF_IPX,
+	create:		ipx_create,
 };
 
 static struct proto_ops SOCKOPS_WRAPPED(ipx_dgram_ops) = {
@@ -2423,7 +2426,7 @@
 	poll:		datagram_poll,
 	ioctl:		ipx_ioctl,
 	listen:		sock_no_listen,
-	shutdown:	sock_no_shutdown, /* FIXME: We have to really support shutdown. */
+	shutdown:	sock_no_shutdown, /* FIXME: have to support shutdown */
 	setsockopt:	ipx_setsockopt,
 	getsockopt:	ipx_getsockopt,
 	sendmsg:	ipx_sendmsg,
@@ -2437,26 +2440,20 @@
 static struct packet_type ipx_8023_packet_type =
 
 {
-	__constant_htons(ETH_P_802_3),
-	NULL,		/* All devices */
-	ipx_rcv,
-	(void *) 1,	/* yap, I understand shared skbs :-) */
-	NULL,
+	type:		__constant_htons(ETH_P_802_3),
+	func:		ipx_rcv,
+	data:		(void *) 1,	/* yap, I understand shared skbs :-) */
 };
 
 static struct packet_type ipx_dix_packet_type =
 {
-	__constant_htons(ETH_P_IPX),
-	NULL,		/* All devices */
-	ipx_rcv,
-	(void *) 1,	/* yap, I understand shared skbs :-) */
-	NULL,
+	type:		__constant_htons(ETH_P_IPX),
+	func:		ipx_rcv,
+	data:		(void *) 1,	/* yap, I understand shared skbs :-) */
 };
 
-static struct notifier_block ipx_dev_notifier={
-	ipxitf_device_event,
-	NULL,
-	0
+static struct notifier_block ipx_dev_notifier = {
+	notifier_call:	ipxitf_device_event,
 };
 
 
@@ -2492,7 +2489,7 @@
 	proc_net_create("ipx_interface", 0, ipx_interface_get_info);
 	proc_net_create("ipx_route", 0, ipx_rt_get_info);
 #endif
-	printk(KERN_INFO "NET4: Linux IPX 0.43 for NET4.0\n");
+	printk(KERN_INFO "NET4: Linux IPX 0.44 for NET4.0\n");
 	printk(KERN_INFO "IPX Portions Copyright (c) 1995 Caldera, Inc.\n");
 	printk(KERN_INFO "IPX Portions Copyright (c) 2000 Conectiva, Inc.\n");
 	return 0;
diff -urN linux-2.4.2-pre2/net/irda/compressors/irda_deflate.c linux/net/irda/compressors/irda_deflate.c
--- linux-2.4.2-pre2/net/irda/compressors/irda_deflate.c	Sat Nov 11 18:11:22 2000
+++ linux/net/irda/compressors/irda_deflate.c	Mon Dec  3 22:28:21 2001
@@ -51,7 +51,7 @@
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h> 
 #include <linux/errno.h>
 #include <linux/string.h>	/* used in new tty drivers */
diff -urN linux-2.4.2-pre2/net/irda/irlap.c linux/net/irda/irlap.c
--- linux-2.4.2-pre2/net/irda/irlap.c	Mon Dec  3 22:28:13 2001
+++ linux/net/irda/irlap.c	Mon Dec  3 22:28:21 2001
@@ -29,7 +29,7 @@
  ********************************************************************/
 
 #include <linux/config.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/skbuff.h>
 #include <linux/delay.h>
diff -urN linux-2.4.2-pre2/net/irda/irlmp.c linux/net/irda/irlmp.c
--- linux-2.4.2-pre2/net/irda/irlmp.c	Sat Nov 11 18:11:23 2000
+++ linux/net/irda/irlmp.c	Mon Dec  3 22:28:21 2001
@@ -24,7 +24,7 @@
  ********************************************************************/
 
 #include <linux/config.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/skbuff.h>
 #include <linux/types.h>
diff -urN linux-2.4.2-pre2/net/khttpd/misc.c linux/net/khttpd/misc.c
--- linux-2.4.2-pre2/net/khttpd/misc.c	Thu Sep  2 11:47:20 1999
+++ linux/net/khttpd/misc.c	Mon Dec  3 22:28:21 2001
@@ -26,7 +26,7 @@
 
 #include <linux/ctype.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/net.h>
 #include <linux/sched.h>
 #include <linux/skbuff.h>
diff -urN linux-2.4.2-pre2/net/khttpd/rfc.c linux/net/khttpd/rfc.c
--- linux-2.4.2-pre2/net/khttpd/rfc.c	Mon Aug 23 10:41:25 1999
+++ linux/net/khttpd/rfc.c	Mon Dec  3 22:28:21 2001
@@ -28,7 +28,7 @@
 
 #include <linux/ctype.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/net.h>
 #include <linux/sched.h>
 #include <linux/skbuff.h>
diff -urN linux-2.4.2-pre2/net/khttpd/rfc_time.c linux/net/khttpd/rfc_time.c
--- linux-2.4.2-pre2/net/khttpd/rfc_time.c	Wed Aug 18 09:51:31 1999
+++ linux/net/khttpd/rfc_time.c	Mon Dec  3 22:28:21 2001
@@ -27,7 +27,7 @@
 
 #include <linux/time.h>
 #include <linux/kernel.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/ctype.h>
 
 
diff -urN linux-2.4.2-pre2/net/khttpd/security.c linux/net/khttpd/security.c
--- linux-2.4.2-pre2/net/khttpd/security.c	Wed Jul  5 11:31:02 2000
+++ linux/net/khttpd/security.c	Mon Dec  3 22:28:21 2001
@@ -27,7 +27,7 @@
 #include <linux/kernel.h>
 
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/net.h>
 #include <linux/sched.h>
 #include <linux/skbuff.h>
diff -urN linux-2.4.2-pre2/net/khttpd/sysctl.c linux/net/khttpd/sysctl.c
--- linux-2.4.2-pre2/net/khttpd/sysctl.c	Mon Aug 23 13:44:03 1999
+++ linux/net/khttpd/sysctl.c	Mon Dec  3 22:28:21 2001
@@ -25,7 +25,7 @@
 
 #include <linux/kernel.h>
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/net.h>
 #include <linux/sched.h>
 #include <linux/skbuff.h>
@@ -259,7 +259,7 @@
 static int proc_dosecurestring(ctl_table *table, int write, struct file *filp,
 		  void *buffer, size_t *lenp)
 {
-	int len;
+	size_t len;
 	char *p, c=0;
 	char String[256];
 	
diff -urN linux-2.4.2-pre2/net/khttpd/userspace.c linux/net/khttpd/userspace.c
--- linux-2.4.2-pre2/net/khttpd/userspace.c	Wed Feb  9 20:08:09 2000
+++ linux/net/khttpd/userspace.c	Mon Dec  3 22:28:21 2001
@@ -35,7 +35,7 @@
 #include <linux/kernel.h>
 
 #include <linux/errno.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/net.h>
 #include <linux/sched.h>
 #include <linux/skbuff.h>
diff -urN linux-2.4.2-pre2/net/lapb/Makefile linux/net/lapb/Makefile
--- linux-2.4.2-pre2/net/lapb/Makefile	Fri Dec 29 14:07:24 2000
+++ linux/net/lapb/Makefile	Mon Dec  3 22:28:21 2001
@@ -17,5 +17,3 @@
 
 include $(TOPDIR)/Rules.make
 
-tar:
-		tar -cvf /dev/f1 .
diff -urN linux-2.4.2-pre2/net/lapb/lapb_iface.c linux/net/lapb/lapb_iface.c
--- linux-2.4.2-pre2/net/lapb/lapb_iface.c	Sat Nov 11 19:02:40 2000
+++ linux/net/lapb/lapb_iface.c	Mon Dec  3 22:28:21 2001
@@ -16,7 +16,6 @@
  */
  
 #include <linux/config.h>
-#if defined(CONFIG_LAPB) || defined(CONFIG_LAPB_MODULE)
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/types.h>
@@ -41,7 +40,7 @@
 #include <linux/init.h>
 #include <net/lapb.h>
 
-static lapb_cb *volatile lapb_list = NULL;
+static lapb_cb *volatile lapb_list /* = NULL initially */;
 
 /*
  *	Free an allocated lapb control block. This is done to centralise
@@ -271,7 +270,7 @@
 
 	return LAPB_OK;
 }
-	
+
 int lapb_disconnect_request(void *token)
 {
 	lapb_cb *lapb;
@@ -399,18 +398,15 @@
 EXPORT_SYMBOL(lapb_data_request);
 EXPORT_SYMBOL(lapb_data_received);
 
+static const char banner[] __initdata = KERN_INFO "NET4: LAPB for Linux. Version 0.01 for NET4.0\n";
+
 static int __init lapb_init(void)
 {
-	printk(KERN_INFO "NET4: LAPB for Linux. Version 0.01 for NET4.0\n");
+	printk(banner);
 	return 0;
 }
 
-#ifdef MODULE
 MODULE_AUTHOR("Jonathan Naylor <g4klx@g4klx.demon.co.uk>");
 MODULE_DESCRIPTION("The X.25 Link Access Procedure B link layer protocol");
-#endif
-
 
 module_init(lapb_init);
-
-#endif
diff -urN linux-2.4.2-pre2/net/lapb/lapb_in.c linux/net/lapb/lapb_in.c
--- linux-2.4.2-pre2/net/lapb/lapb_in.c	Sat Nov 11 19:02:40 2000
+++ linux/net/lapb/lapb_in.c	Mon Dec  3 22:28:21 2001
@@ -15,8 +15,6 @@
  *	2000-10-29	Henner Eisen	lapb_data_indication() return status.
  */
 
-#include <linux/config.h>
-#if defined(CONFIG_LAPB) || defined(CONFIG_LAPB_MODULE)
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
@@ -641,5 +639,3 @@
 
 	lapb_kick(lapb);
 }
-
-#endif
diff -urN linux-2.4.2-pre2/net/lapb/lapb_out.c linux/net/lapb/lapb_out.c
--- linux-2.4.2-pre2/net/lapb/lapb_out.c	Tue Feb 10 13:07:49 1998
+++ linux/net/lapb/lapb_out.c	Mon Dec  3 22:28:21 2001
@@ -14,8 +14,6 @@
  *	LAPB 002	Jonathan Naylor	New timer architecture.
  */
 
-#include <linux/config.h>
-#if defined(CONFIG_LAPB) || defined(CONFIG_LAPB_MODULE)
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
@@ -223,5 +221,3 @@
 	if (type == LAPB_COMMAND && pf)
 		lapb_enquiry_response(lapb);
 }
-
-#endif
diff -urN linux-2.4.2-pre2/net/lapb/lapb_subr.c linux/net/lapb/lapb_subr.c
--- linux-2.4.2-pre2/net/lapb/lapb_subr.c	Tue Feb 10 13:07:49 1998
+++ linux/net/lapb/lapb_subr.c	Mon Dec  3 22:28:21 2001
@@ -13,8 +13,6 @@
  *	LAPB 001	Jonathan Naylor	Started Coding
  */
 
-#include <linux/config.h>
-#if defined(CONFIG_LAPB) || defined(CONFIG_LAPB_MODULE)
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
@@ -281,5 +279,3 @@
 
 	lapb_transmit_buffer(lapb, skb, LAPB_RESPONSE);
 }
-
-#endif
diff -urN linux-2.4.2-pre2/net/lapb/lapb_timer.c linux/net/lapb/lapb_timer.c
--- linux-2.4.2-pre2/net/lapb/lapb_timer.c	Thu May  4 11:26:52 2000
+++ linux/net/lapb/lapb_timer.c	Mon Dec  3 22:28:21 2001
@@ -14,8 +14,6 @@
  *	LAPB 002	Jonathan Naylor	New timer architecture.
  */
 
-#include <linux/config.h>
-#if defined(CONFIG_LAPB) || defined(CONFIG_LAPB_MODULE)
 #include <linux/errno.h>
 #include <linux/types.h>
 #include <linux/socket.h>
@@ -189,5 +187,3 @@
 
 	lapb_start_t1timer(lapb);
 }
-
-#endif
diff -urN linux-2.4.2-pre2/net/netlink/af_netlink.c linux/net/netlink/af_netlink.c
--- linux-2.4.2-pre2/net/netlink/af_netlink.c	Sat Nov 11 19:02:41 2000
+++ linux/net/netlink/af_netlink.c	Mon Dec  3 22:28:21 2001
@@ -29,7 +29,7 @@
 #include <linux/sockios.h>
 #include <linux/net.h>
 #include <linux/fs.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <asm/uaccess.h>
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
diff -urN linux-2.4.2-pre2/net/netlink/netlink_dev.c linux/net/netlink/netlink_dev.c
--- linux-2.4.2-pre2/net/netlink/netlink_dev.c	Mon Oct 16 12:58:51 2000
+++ linux/net/netlink/netlink_dev.c	Mon Dec  3 22:28:21 2001
@@ -20,7 +20,7 @@
 #include <linux/kernel.h>
 #include <linux/major.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/skbuff.h>
 #include <linux/netlink.h>
 #include <linux/poll.h>
diff -urN linux-2.4.2-pre2/net/netrom/Makefile linux/net/netrom/Makefile
--- linux-2.4.2-pre2/net/netrom/Makefile	Fri Dec 29 14:07:24 2000
+++ linux/net/netrom/Makefile	Mon Dec  3 22:28:21 2001
@@ -17,5 +17,3 @@
 
 include $(TOPDIR)/Rules.make
 
-tar:
-		tar -cvf /dev/f1 .
diff -urN linux-2.4.2-pre2/net/netsyms.c linux/net/netsyms.c
--- linux-2.4.2-pre2/net/netsyms.c	Fri Oct 27 11:03:14 2000
+++ linux/net/netsyms.c	Mon Dec  3 22:28:21 2001
@@ -17,6 +17,7 @@
 #include <linux/trdevice.h>
 #include <linux/fcdevice.h>
 #include <linux/ioport.h>
+#include <linux/tty.h>
 #include <net/neighbour.h>
 #include <net/snmp.h>
 #include <net/dst.h>
diff -urN linux-2.4.2-pre2/net/packet/af_packet.c linux/net/packet/af_packet.c
--- linux-2.4.2-pre2/net/packet/af_packet.c	Mon Jan  1 11:01:58 2001
+++ linux/net/packet/af_packet.c	Mon Dec  3 22:28:21 2001
@@ -62,6 +62,7 @@
 #include <linux/timer.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
+#include <asm/ioctls.h>
 #include <linux/proc_fs.h>
 #include <linux/poll.h>
 #include <linux/module.h>
diff -urN linux-2.4.2-pre2/net/rose/Makefile linux/net/rose/Makefile
--- linux-2.4.2-pre2/net/rose/Makefile	Fri Dec 29 14:07:24 2000
+++ linux/net/rose/Makefile	Mon Dec  3 22:28:21 2001
@@ -17,5 +17,3 @@
 
 include $(TOPDIR)/Rules.make
 
-tar:
-		tar -cvf /dev/f1 .
diff -urN linux-2.4.2-pre2/net/sched/sch_atm.c linux/net/sched/sch_atm.c
--- linux-2.4.2-pre2/net/sched/sch_atm.c	Tue Mar 21 23:38:27 2000
+++ linux/net/sched/sch_atm.c	Mon Dec  3 22:28:21 2001
@@ -5,6 +5,8 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/string.h>
+#include <linux/errno.h>
 #include <linux/skbuff.h>
 #include <linux/interrupt.h>
 #include <linux/atmdev.h>
diff -urN linux-2.4.2-pre2/net/sched/sch_dsmark.c linux/net/sched/sch_dsmark.c
--- linux-2.4.2-pre2/net/sched/sch_dsmark.c	Mon Jan 22 13:30:21 2001
+++ linux/net/sched/sch_dsmark.c	Mon Dec  3 22:28:21 2001
@@ -6,6 +6,8 @@
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
+#include <linux/string.h>
+#include <linux/errno.h>
 #include <linux/skbuff.h>
 #include <linux/netdevice.h> /* for pkt_sched */
 #include <linux/rtnetlink.h>
diff -urN linux-2.4.2-pre2/net/sunrpc/auth.c linux/net/sunrpc/auth.c
--- linux-2.4.2-pre2/net/sunrpc/auth.c	Tue Jan 23 15:22:24 2001
+++ linux/net/sunrpc/auth.c	Mon Dec  3 22:28:21 2001
@@ -8,7 +8,7 @@
 
 #include <linux/types.h>
 #include <linux/sched.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/errno.h>
 #include <linux/socket.h>
 #include <linux/sunrpc/clnt.h>
diff -urN linux-2.4.2-pre2/net/sunrpc/auth_null.c linux/net/sunrpc/auth_null.c
--- linux-2.4.2-pre2/net/sunrpc/auth_null.c	Fri Oct 13 12:11:26 2000
+++ linux/net/sunrpc/auth_null.c	Mon Dec  3 22:28:21 2001
@@ -7,7 +7,7 @@
  */
 
 #include <linux/types.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/socket.h>
 #include <linux/in.h>
 #include <linux/utsname.h>
diff -urN linux-2.4.2-pre2/net/sunrpc/auth_unix.c linux/net/sunrpc/auth_unix.c
--- linux-2.4.2-pre2/net/sunrpc/auth_unix.c	Mon Sep 25 13:13:53 2000
+++ linux/net/sunrpc/auth_unix.c	Mon Dec  3 22:28:21 2001
@@ -7,7 +7,7 @@
  */
 
 #include <linux/types.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/socket.h>
 #include <linux/in.h>
 #include <linux/sunrpc/clnt.h>
diff -urN linux-2.4.2-pre2/net/sunrpc/clnt.c linux/net/sunrpc/clnt.c
--- linux-2.4.2-pre2/net/sunrpc/clnt.c	Tue Nov 28 22:34:01 2000
+++ linux/net/sunrpc/clnt.c	Mon Dec  3 22:28:21 2001
@@ -25,7 +25,7 @@
 
 #include <linux/types.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/in.h>
 #include <linux/utsname.h>
 
diff -urN linux-2.4.2-pre2/net/sunrpc/sched.c linux/net/sunrpc/sched.c
--- linux-2.4.2-pre2/net/sunrpc/sched.c	Tue Dec  5 12:29:39 2000
+++ linux/net/sunrpc/sched.c	Mon Dec  3 22:28:21 2001
@@ -14,7 +14,7 @@
 #define __KERNEL_SYSCALLS__
 #include <linux/sched.h>
 #include <linux/interrupt.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/unistd.h>
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
diff -urN linux-2.4.2-pre2/net/sunrpc/svcsock.c linux/net/sunrpc/svcsock.c
--- linux-2.4.2-pre2/net/sunrpc/svcsock.c	Mon Oct 30 14:41:41 2000
+++ linux/net/sunrpc/svcsock.c	Mon Dec  3 22:28:21 2001
@@ -28,13 +28,14 @@
 #include <linux/udp.h>
 #include <linux/version.h>
 #include <linux/unistd.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <net/sock.h>
 #include <net/checksum.h>
 #include <net/ip.h>
 #include <asm/uaccess.h>
+#include <asm/ioctls.h>
 
 #include <linux/sunrpc/types.h>
 #include <linux/sunrpc/xdr.h>
diff -urN linux-2.4.2-pre2/net/sunrpc/xprt.c linux/net/sunrpc/xprt.c
--- linux-2.4.2-pre2/net/sunrpc/xprt.c	Tue Nov 28 22:34:01 2000
+++ linux/net/sunrpc/xprt.c	Mon Dec  3 22:28:21 2001
@@ -47,7 +47,7 @@
 
 #include <linux/version.h>
 #include <linux/types.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/capability.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
diff -urN linux-2.4.2-pre2/net/unix/af_unix.c linux/net/unix/af_unix.c
--- linux-2.4.2-pre2/net/unix/af_unix.c	Mon Jan 22 13:30:21 2001
+++ linux/net/unix/af_unix.c	Mon Dec  3 22:28:21 2001
@@ -8,7 +8,7 @@
  *		as published by the Free Software Foundation; either version
  *		2 of the License, or (at your option) any later version.
  *
- * Version:	$Id: af_unix.c,v 1.109 2001/01/06 00:42:23 davem Exp $
+ * Version:	$Id: af_unix.c,v 1.111 2001/02/02 11:37:28 davem Exp $
  *
  * Fixes:
  *		Linus Torvalds	:	Assorted bug cures.
@@ -96,7 +96,7 @@
 #include <linux/net.h>
 #include <linux/in.h>
 #include <linux/fs.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <asm/uaccess.h>
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
@@ -1316,9 +1316,12 @@
 		size=len-sent;
 
 		/* Keep two messages in the pipe so it schedules better */
-		if (size > sk->sndbuf/2 - 16)
-			size = sk->sndbuf/2 - 16;
+		if (size > sk->sndbuf/2 - 64)
+			size = sk->sndbuf/2 - 64;
 
+		if (size > (128 * 1024) / 2)
+			size = (128 * 1024) / 2;
+			
 		/*
 		 *	Keep to page sized kmalloc()'s as various people
 		 *	have suggested. Big mallocs stress the vm too
diff -urN linux-2.4.2-pre2/net/unix/garbage.c linux/net/unix/garbage.c
--- linux-2.4.2-pre2/net/unix/garbage.c	Fri Nov 17 11:36:27 2000
+++ linux/net/unix/garbage.c	Mon Dec  3 22:28:21 2001
@@ -71,7 +71,7 @@
 #include <linux/un.h>
 #include <linux/net.h>
 #include <linux/fs.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
 #include <linux/file.h>
diff -urN linux-2.4.2-pre2/net/wanrouter/wanmain.c linux/net/wanrouter/wanmain.c
--- linux-2.4.2-pre2/net/wanrouter/wanmain.c	Thu Feb 17 09:18:47 2000
+++ linux/net/wanrouter/wanmain.c	Mon Dec  3 22:28:21 2001
@@ -41,7 +41,7 @@
 #include <linux/errno.h>	/* return codes */
 #include <linux/kernel.h>
 #include <linux/module.h>	/* support for loadable modules */
-#include <linux/malloc.h>	/* kmalloc(), kfree() */
+#include <linux/slab.h>	/* kmalloc(), kfree() */
 #include <linux/mm.h>		/* verify_area(), etc. */
 #include <linux/string.h>	/* inline mem*, str* functions */
 #include <linux/vmalloc.h>	/* vmalloc, vfree */
diff -urN linux-2.4.2-pre2/net/wanrouter/wanproc.c linux/net/wanrouter/wanproc.c
--- linux-2.4.2-pre2/net/wanrouter/wanproc.c	Sat Feb 26 20:33:10 2000
+++ linux/net/wanrouter/wanproc.c	Mon Dec  3 22:28:21 2001
@@ -13,6 +13,7 @@
 *		as published by the Free Software Foundation; either version
 *		2 of the License, or (at your option) any later version.
 * ============================================================================
+* Jan 20, 2001  Arnaldo C.Melo  Fix leak on error in router_proc_read, cleanups
 * Jun 02, 1999  Gideon Hack	Updates for Linux 2.2.X kernels.
 * Jun 29, 1997	Alan Cox	Merged with 1.0.3 vendor code
 * Jan 29, 1997	Gene Kozin	v1.0.1. Implemented /proc read routines
@@ -25,7 +26,7 @@
 #include <linux/stddef.h>	/* offsetof(), etc. */
 #include <linux/errno.h>	/* return codes */
 #include <linux/kernel.h>
-#include <linux/malloc.h>	/* kmalloc(), kfree() */
+#include <linux/slab.h>	/* kmalloc(), kfree() */
 #include <linux/mm.h>		/* verify_area(), etc. */
 #include <linux/string.h>	/* inline mem*, str* functions */
 #include <linux/init.h>		/* __init et al. */
@@ -43,23 +44,9 @@
 #ifndef	min
 #define min(a,b) (((a)<(b))?(a):(b))
 #endif
-#ifndef	max
-#define max(a,b) (((a)>(b))?(a):(b))
-#endif
 
 #define	PROC_BUFSZ	4000	/* buffer size for printing proc info */
 
-
-/****** Data Types **********************************************************/
-
-typedef struct wan_stat_entry
-{
-	struct wan_stat_entry *next;
-	char *description;		/* description string */
-	void *data;			/* -> data */
-	unsigned data_type;		/* data type */
-} wan_stat_entry_t;
-
 /****** Function Prototypes *************************************************/
 
 #ifdef CONFIG_PROC_FS
@@ -78,7 +65,7 @@
 
 /*
  *	Structures for interfacing with the /proc filesystem.
- *	Router creates its own directory /proc/net/router with the folowing
+ *	Router creates its own directory /proc/net/wanrouter with the folowing
  *	entries:
  *	config		device configuration
  *	status		global device statistics
@@ -86,7 +73,7 @@
  */
 
 /*
- *	Generic /proc/net/router/<file> file and inode operations 
+ *	Generic /proc/net/wanrouter/<file> file and inode operations 
  */
 static struct file_operations router_fops =
 {
@@ -99,7 +86,7 @@
 };
 
 /*
- *	/proc/net/router/<device> file operations
+ *	/proc/net/wanrouter/<device> file operations
  */
 
 static struct file_operations wandev_fops =
@@ -109,7 +96,7 @@
 };
 
 /*
- *	/proc/net/router 
+ *	/proc/net/wanrouter 
  */
 
 static struct proc_dir_entry *proc_router;
@@ -251,13 +238,15 @@
 	offs = file->f_pos;
 	if (offs < pos) {
 		len = min(pos - offs, count);
-		if(copy_to_user(buf, (page + offs), len))
-			return -EFAULT;
+		if(copy_to_user(buf, (page + offs), len)) {
+			len = -EFAULT;
+			goto out;
+		}
 		file->f_pos += len;
 	}
 	else
 		len = 0;
-	kfree(page);
+out:	kfree(page);
 	return len;
 }
 
