[PATCH] DMI: move dmi_scan.c from arch/i386 to drivers/firmware/
authorBjorn Helgaas <bjorn.helgaas@hp.com>
Tue, 4 Apr 2006 00:09:22 +0000 (17:09 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 14 Apr 2006 18:41:25 +0000 (11:41 -0700)
dmi_scan.c is arch-independent and is used by i386, x86_64, and ia64.
Currently all three arches compile it from arch/i386, which means that ia64
and x86_64 depend on things in arch/i386 that they wouldn't otherwise care
about.

This is simply "mv arch/i386/kernel/dmi_scan.c drivers/firmware/" (removing
trailing whitespace) and the associated Makefile changes.  All three
architectures already set CONFIG_DMI in their top-level Kconfig files.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Andi Kleen <ak@muc.de>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Andrey Panin <pazke@orbita1.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/i386/kernel/Makefile
arch/ia64/kernel/Makefile
arch/x86_64/kernel/Makefile
drivers/firmware/Makefile
drivers/firmware/dmi_scan.c [moved from arch/i386/kernel/dmi_scan.c with 98% similarity]

index 5b9ed21..96fb8a0 100644 (file)
@@ -6,7 +6,7 @@ extra-y := head.o init_task.o vmlinux.lds
 
 obj-y  := process.o semaphore.o signal.o entry.o traps.o irq.o \
                ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \
-               pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \
+               pci-dma.o i386_ksyms.o i387.o bootflag.o \
                quirks.o i8237.o topology.o alternative.o
 
 obj-y                          += cpu/
index 59e871d..09a0dbc 100644 (file)
@@ -7,7 +7,7 @@ extra-y := head.o init_task.o vmlinux.lds
 obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o      \
         irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o          \
         salinfo.o semaphore.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o \
-        unwind.o mca.o mca_asm.o topology.o dmi_scan.o
+        unwind.o mca.o mca_asm.o topology.o
 
 obj-$(CONFIG_IA64_BRL_EMU)     += brl_emu.o
 obj-$(CONFIG_IA64_GENERIC)     += acpi-ext.o
@@ -30,7 +30,6 @@ obj-$(CONFIG_IA64_MCA_RECOVERY)       += mca_recovery.o
 obj-$(CONFIG_KPROBES)          += kprobes.o jprobes.o
 obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR)  += uncached.o
 mca_recovery-y                 += mca_drv.o mca_drv_asm.o
-dmi_scan-y                     += ../../i386/kernel/dmi_scan.o
 
 # The gate DSO image is built using a special linker script.
 targets += gate.so gate-syms.o
index a098a11..059c883 100644 (file)
@@ -8,7 +8,7 @@ obj-y   := process.o signal.o entry.o traps.o irq.o \
                ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \
                x8664_ksyms.o i387.o syscall.o vsyscall.o \
                setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \
-               dmi_scan.o pci-dma.o pci-nommu.o
+               pci-dma.o pci-nommu.o
 
 obj-$(CONFIG_X86_MCE)         += mce.o
 obj-$(CONFIG_X86_MCE_INTEL)    += mce_intel.o
@@ -49,5 +49,3 @@ intel_cacheinfo-y             += ../../i386/kernel/cpu/intel_cacheinfo.o
 quirks-y                       += ../../i386/kernel/quirks.o
 i8237-y                                += ../../i386/kernel/i8237.o
 msr-$(subst m,y,$(CONFIG_X86_MSR))  += ../../i386/kernel/msr.o
-dmi_scan-y                     += ../../i386/kernel/dmi_scan.o
-
index 8542997..98e395f 100644 (file)
@@ -1,7 +1,8 @@
 #
 # Makefile for the linux kernel.
 #
-obj-$(CONFIG_EDD)              += edd.o
+obj-$(CONFIG_DMI)              += dmi_scan.o
+obj-$(CONFIG_EDD)              += edd.o
 obj-$(CONFIG_EFI_VARS)         += efivars.o
 obj-$(CONFIG_EFI_PCDP)         += pcdp.o
 obj-$(CONFIG_DELL_RBU)          += dell_rbu.o
similarity index 98%
rename from arch/i386/kernel/dmi_scan.c
rename to drivers/firmware/dmi_scan.c
index 5efceeb..948bd7e 100644 (file)
@@ -27,7 +27,7 @@ static char * __init dmi_string(struct dmi_header *dm, u8 s)
                        else
                                printk(KERN_ERR "dmi_string: out of memory.\n");
                }
-       }
+       }
 
        return str;
 }
@@ -41,7 +41,7 @@ static int __init dmi_table(u32 base, int len, int num,
 {
        u8 *buf, *data;
        int i = 0;
-               
+
        buf = dmi_ioremap(base, len);
        if (buf == NULL)
                return -1;
@@ -49,9 +49,9 @@ static int __init dmi_table(u32 base, int len, int num,
        data = buf;
 
        /*
-        *      Stop when we see all the items the table claimed to have
-        *      OR we run off the end of the table (also happens)
-        */
+        *      Stop when we see all the items the table claimed to have
+        *      OR we run off the end of the table (also happens)
+        */
        while ((i < num) && (data - buf + sizeof(struct dmi_header)) <= len) {
                struct dmi_header *dm = (struct dmi_header *)data;
                /*
@@ -75,7 +75,7 @@ static int __init dmi_checksum(u8 *buf)
 {
        u8 sum = 0;
        int a;
-       
+
        for (a = 0; a < 15; a++)
                sum += buf[a];