]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[S390] move sysinfo.c from drivers/s390 to arch/s390/kernel
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Thu, 26 Mar 2009 14:23:50 +0000 (15:23 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 26 Mar 2009 14:24:06 +0000 (15:24 +0100)
All in sysinfo.c is core kernel code and not driver code. So move it
to arch/s390/kernel. Also includes some small cleanups.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/Makefile
arch/s390/kernel/sysinfo.c [moved from drivers/s390/sysinfo.c with 88% similarity]
drivers/s390/Makefile

index 3edc6c6f258b2a06b9f7bb09591964ebbce7ebd3..33e7aee705133e9275d595f6cf97c7bb8db29a37 100644 (file)
@@ -17,10 +17,12 @@ CFLAGS_smp.o        := -Wno-nonnull
 #
 CFLAGS_ptrace.o                += -DUTS_MACHINE='"$(UTS_MACHINE)"'
 
+CFLAGS_sysinfo.o += -Iinclude/math-emu -Iarch/s390/math-emu -w
+
 obj-y  :=  bitmap.o traps.o time.o process.o base.o early.o setup.o \
            processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \
            s390_ext.o debug.o irq.o ipl.o dis.o diag.o mem_detect.o \
-           vdso.o vtime.o
+           vdso.o vtime.o sysinfo.o
 
 obj-y  += $(if $(CONFIG_64BIT),entry64.o,entry.o)
 obj-y  += $(if $(CONFIG_64BIT),reipl64.o,reipl.o)
similarity index 88%
rename from drivers/s390/sysinfo.c
rename to arch/s390/kernel/sysinfo.c
index 0eea90781385784ae4ab838dce905dcaf4942a89..b5e75e1061c82d35b40b63594f1889ce07d0453b 100644 (file)
@@ -1,9 +1,7 @@
 /*
- *  drivers/s390/sysinfo.c
- *
- *  Copyright IBM Corp. 2001, 2008
- *  Author(s): Ulrich Weigand (Ulrich.Weigand@de.ibm.com)
- *            Martin Schwidefsky <schwidefsky@de.ibm.com>
+ *  Copyright IBM Corp. 2001, 2009
+ *  Author(s): Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
+ *            Martin Schwidefsky <schwidefsky@de.ibm.com>,
  */
 
 #include <linux/kernel.h>
@@ -24,7 +22,7 @@
 
 static inline int stsi_0(void)
 {
-       int rc = stsi (NULL, 0, 0, 0);
+       int rc = stsi(NULL, 0, 0, 0);
        return rc == -ENOSYS ? rc : (((unsigned int) rc) >> 28);
 }
 
@@ -78,23 +76,6 @@ static int stsi_1_1_1(struct sysinfo_1_1_1 *info, char *page, int len)
        return len;
 }
 
-#if 0 /* Currently unused */
-static int stsi_1_2_1(struct sysinfo_1_2_1 *info, char *page, int len)
-{
-       if (stsi(info, 1, 2, 1) == -ENOSYS)
-               return len;
-
-       len += sprintf(page + len, "\n");
-       EBCASC(info->sequence, sizeof(info->sequence));
-       EBCASC(info->plant, sizeof(info->plant));
-       len += sprintf(page + len, "Sequence Code of CPU: %-16.16s\n",
-                      info->sequence);
-       len += sprintf(page + len, "Plant of CPU:         %-16.16s\n",
-                      info->plant);
-       return len;
-}
-#endif
-
 static int stsi_1_2_2(struct sysinfo_1_2_2 *info, char *page, int len)
 {
        struct sysinfo_1_2_2_extension *ext;
@@ -145,33 +126,15 @@ static int stsi_1_2_2(struct sysinfo_1_2_2 *info, char *page, int len)
        if (info->secondary_capability != 0)
                len += sprintf(page + len, "Secondary Capability: %d\n",
                               info->secondary_capability);
-
        return len;
 }
 
-#if 0 /* Currently unused */
-static int stsi_2_2_1(struct sysinfo_2_2_1 *info, char *page, int len)
-{
-       if (stsi(info, 2, 2, 1) == -ENOSYS)
-               return len;
-
-       len += sprintf(page + len, "\n");
-       EBCASC (info->sequence, sizeof(info->sequence));
-       EBCASC (info->plant, sizeof(info->plant));
-       len += sprintf(page + len, "Sequence Code of logical CPU: %-16.16s\n",
-                      info->sequence);
-       len += sprintf(page + len, "Plant of logical CPU: %-16.16s\n",
-                      info->plant);
-       return len;
-}
-#endif
-
 static int stsi_2_2_2(struct sysinfo_2_2_2 *info, char *page, int len)
 {
        if (stsi(info, 2, 2, 2) == -ENOSYS)
                return len;
 
-       EBCASC (info->name, sizeof(info->name));
+       EBCASC(info->name, sizeof(info->name));
 
        len += sprintf(page + len, "\n");
        len += sprintf(page + len, "LPAR Number:          %d\n",
@@ -214,8 +177,8 @@ static int stsi_3_2_2(struct sysinfo_3_2_2 *info, char *page, int len)
        if (stsi(info, 3, 2, 2) == -ENOSYS)
                return len;
        for (i = 0; i < info->count; i++) {
-               EBCASC (info->vm[i].name, sizeof(info->vm[i].name));
-               EBCASC (info->vm[i].cpi, sizeof(info->vm[i].cpi));
+               EBCASC(info->vm[i].name, sizeof(info->vm[i].name));
+               EBCASC(info->vm[i].cpi, sizeof(info->vm[i].cpi));
                len += sprintf(page + len, "\n");
                len += sprintf(page + len, "VM%02d Name:            %-8.8s\n",
                               i, info->vm[i].name);
@@ -237,14 +200,13 @@ static int stsi_3_2_2(struct sysinfo_3_2_2 *info, char *page, int len)
        return len;
 }
 
-
 static int proc_read_sysinfo(char *page, char **start,
-                             off_t off, int count,
-                             int *eof, void *data)
+                            off_t off, int count,
+                            int *eof, void *data)
 {
-       unsigned long info = get_zeroed_page (GFP_KERNEL);
+       unsigned long info = get_zeroed_page(GFP_KERNEL);
        int level, len;
-       
+
        if (!info)
                return 0;
 
@@ -262,8 +224,8 @@ static int proc_read_sysinfo(char *page, char **start,
        if (level >= 3)
                len = stsi_3_2_2((struct sysinfo_3_2_2 *) info, page, len);
 
-       free_page (info);
-        return len;
+       free_page(info);
+       return len;
 }
 
 static __init int create_proc_sysinfo(void)
@@ -272,8 +234,7 @@ static __init int create_proc_sysinfo(void)
                               proc_read_sysinfo, NULL);
        return 0;
 }
-
-__initcall(create_proc_sysinfo);
+device_initcall(create_proc_sysinfo);
 
 /*
  * Service levels interface.
@@ -387,13 +348,11 @@ static __init int create_proc_service_level(void)
                register_service_level(&service_level_vm);
        return 0;
 }
-
 subsys_initcall(create_proc_service_level);
 
 /*
  * Bogomips calculation based on cpu capability.
  */
-
 int get_cpu_capability(unsigned int *capability)
 {
        struct sysinfo_1_2_2 *info;
index d0eae59bc3667ce8d2ee56d484777d7cb5d32ccd..0828dc839355d9776c653166ebb99292582a1d77 100644 (file)
@@ -2,9 +2,7 @@
 # Makefile for the S/390 specific device drivers
 #
 
-CFLAGS_sysinfo.o += -Iinclude/math-emu -Iarch/s390/math-emu -w
-
-obj-y += s390mach.o sysinfo.o
+obj-y += s390mach.o
 obj-y += cio/ block/ char/ crypto/ net/ scsi/ kvm/
 
 drivers-y += drivers/s390/built-in.o