Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch adjust to new signature; return consistent stuff. 0...



details:   https://anonhg.NetBSD.org/src/rev/0289d55bdf19
branches:  trunk
changeset: 795260:0289d55bdf19
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Apr 05 18:44:32 2014 +0000

description:
adjust to new signature; return consistent stuff. 0 is ok -1 is error

diffstat:

 sys/arch/alpha/alpha/procfs_machdep.c       |   6 +++---
 sys/arch/arm/arm/procfs_machdep.c           |   6 +++---
 sys/arch/hppa/hppa/procfs_machdep.c         |   6 +++---
 sys/arch/m68k/m68k/procfs_machdep.c         |  13 ++++++-------
 sys/arch/mips/mips/procfs_machdep.c         |   6 +++---
 sys/arch/powerpc/powerpc/procfs_machdep.c   |   8 ++++----
 sys/arch/sh3/sh3/procfs_machdep.c           |   6 +++---
 sys/arch/sparc/sparc/procfs_machdep.c       |   6 +++---
 sys/arch/sparc64/sparc64/procfs_machdep.c   |   6 +++---
 sys/arch/usermode/usermode/procfs_machdep.c |   6 +++---
 sys/arch/vax/vax/procfs_machdep.c           |   6 +++---
 11 files changed, 37 insertions(+), 38 deletions(-)

diffs (271 lines):

diff -r 4c5c71c9c72e -r 0289d55bdf19 sys/arch/alpha/alpha/procfs_machdep.c
--- a/sys/arch/alpha/alpha/procfs_machdep.c     Sat Apr 05 18:43:09 2014 +0000
+++ b/sys/arch/alpha/alpha/procfs_machdep.c     Sat Apr 05 18:44:32 2014 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: procfs_machdep.c,v 1.4 2005/12/11 12:16:10 christos Exp $      */
+/*     $NetBSD: procfs_machdep.c,v 1.5 2014/04/05 18:44:32 christos Exp $      */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.4 2005/12/11 12:16:10 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.5 2014/04/05 18:44:32 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -15,7 +15,7 @@
  * Only used when procfs is mounted with -o linux.
  */
 int
-procfs_getcpuinfstr(char *buf, int *len)
+procfs_getcpuinfstr(char *buf, size_t *len)
 {
        *len = 0;
 
diff -r 4c5c71c9c72e -r 0289d55bdf19 sys/arch/arm/arm/procfs_machdep.c
--- a/sys/arch/arm/arm/procfs_machdep.c Sat Apr 05 18:43:09 2014 +0000
+++ b/sys/arch/arm/arm/procfs_machdep.c Sat Apr 05 18:44:32 2014 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: procfs_machdep.c,v 1.3 2005/12/11 12:16:41 christos Exp $      */
+/*     $NetBSD: procfs_machdep.c,v 1.4 2014/04/05 18:44:32 christos Exp $      */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.3 2005/12/11 12:16:41 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.4 2014/04/05 18:44:32 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -15,7 +15,7 @@
  * Only used when procfs is mounted with -o linux.
  */
 int
-procfs_getcpuinfstr(char *buf, int *len)
+procfs_getcpuinfstr(char *buf, size_t *len)
 {
        *len = 0;
 
diff -r 4c5c71c9c72e -r 0289d55bdf19 sys/arch/hppa/hppa/procfs_machdep.c
--- a/sys/arch/hppa/hppa/procfs_machdep.c       Sat Apr 05 18:43:09 2014 +0000
+++ b/sys/arch/hppa/hppa/procfs_machdep.c       Sat Apr 05 18:44:32 2014 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: procfs_machdep.c,v 1.3 2005/12/11 12:17:37 christos Exp $      */
+/*     $NetBSD: procfs_machdep.c,v 1.4 2014/04/05 18:44:32 christos Exp $      */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.3 2005/12/11 12:17:37 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.4 2014/04/05 18:44:32 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -15,7 +15,7 @@
  * Only used when procfs is mounted with -o linux.
  */
 int
-procfs_getcpuinfstr(char *buf, int *len)
+procfs_getcpuinfstr(char *buf, size_t *len)
 {
        *len = 0;
 
diff -r 4c5c71c9c72e -r 0289d55bdf19 sys/arch/m68k/m68k/procfs_machdep.c
--- a/sys/arch/m68k/m68k/procfs_machdep.c       Sat Apr 05 18:43:09 2014 +0000
+++ b/sys/arch/m68k/m68k/procfs_machdep.c       Sat Apr 05 18:44:32 2014 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: procfs_machdep.c,v 1.6 2014/03/29 11:34:13 apb Exp $ */
+/*     $NetBSD: procfs_machdep.c,v 1.7 2014/04/05 18:44:32 christos Exp $ */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.6 2014/03/29 11:34:13 apb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.7 2014/04/05 18:44:32 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -16,10 +16,10 @@
  * Only used when procfs is mounted with -o linux.
  */
 int
-procfs_getcpuinfstr(char *buf, int *len)
+procfs_getcpuinfstr(char *buf, size_t *len)
 {
        const char *cpu, *mmu, *fpu;
-       int maxlen = *len;
+       size_t size = *len;
 
        switch (cputype) {
        case CPU_68020:
@@ -78,7 +78,7 @@
                break;
        }
 
-       *len = snprintf(buf, maxlen,
+       *len = snprintf(buf, size,
            /* as seen in Linux 2.4.27 */
            "CPU:\t\t%s\n"
            "MMU:\t\t%s\n"
@@ -88,6 +88,5 @@
             * "BogoMips" and "Calibration".
             */
            cpu, mmu, fpu);
-
-       return 0;
+       return size < *len ? -1 : 0;
 }
diff -r 4c5c71c9c72e -r 0289d55bdf19 sys/arch/mips/mips/procfs_machdep.c
--- a/sys/arch/mips/mips/procfs_machdep.c       Sat Apr 05 18:43:09 2014 +0000
+++ b/sys/arch/mips/mips/procfs_machdep.c       Sat Apr 05 18:44:32 2014 +0000
@@ -1,7 +1,7 @@
-/* $NetBSD: procfs_machdep.c,v 1.4 2005/12/11 12:18:09 christos Exp $ */
+/* $NetBSD: procfs_machdep.c,v 1.5 2014/04/05 18:44:32 christos Exp $ */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.4 2005/12/11 12:18:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.5 2014/04/05 18:44:32 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -14,7 +14,7 @@
  * Only used when procfs is mounted with -o linux.
  */
 int
-procfs_getcpuinfstr(char *buf, int *len)
+procfs_getcpuinfstr(char *buf, size_t *len)
 {
        *len = 0;
 
diff -r 4c5c71c9c72e -r 0289d55bdf19 sys/arch/powerpc/powerpc/procfs_machdep.c
--- a/sys/arch/powerpc/powerpc/procfs_machdep.c Sat Apr 05 18:43:09 2014 +0000
+++ b/sys/arch/powerpc/powerpc/procfs_machdep.c Sat Apr 05 18:44:32 2014 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: procfs_machdep.c,v 1.7 2007/10/17 19:56:48 garbled Exp $       */
+/*     $NetBSD: procfs_machdep.c,v 1.8 2014/04/05 18:44:32 christos Exp $      */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.7 2007/10/17 19:56:48 garbled Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.8 2014/04/05 18:44:32 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -20,9 +20,9 @@
  * Only used when procfs is mounted with -o linux.
  */
 int
-procfs_getcpuinfstr(char *buf, int *len)
+procfs_getcpuinfstr(char *buf, size_t *len)
 {
-       *len = 0;
+       *size_t = 0;
 
        return 0;
 }
diff -r 4c5c71c9c72e -r 0289d55bdf19 sys/arch/sh3/sh3/procfs_machdep.c
--- a/sys/arch/sh3/sh3/procfs_machdep.c Sat Apr 05 18:43:09 2014 +0000
+++ b/sys/arch/sh3/sh3/procfs_machdep.c Sat Apr 05 18:44:32 2014 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: procfs_machdep.c,v 1.5 2005/12/11 12:19:00 christos Exp $      */
+/*     $NetBSD: procfs_machdep.c,v 1.6 2014/04/05 18:44:32 christos Exp $      */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.5 2005/12/11 12:19:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.6 2014/04/05 18:44:32 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -15,7 +15,7 @@
  * Only used when procfs is mounted with -o linux.
  */
 int
-procfs_getcpuinfstr(char *buf, int *len)
+procfs_getcpuinfstr(char *buf, size_t *len)
 {
        *len = 0;
 
diff -r 4c5c71c9c72e -r 0289d55bdf19 sys/arch/sparc/sparc/procfs_machdep.c
--- a/sys/arch/sparc/sparc/procfs_machdep.c     Sat Apr 05 18:43:09 2014 +0000
+++ b/sys/arch/sparc/sparc/procfs_machdep.c     Sat Apr 05 18:44:32 2014 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: procfs_machdep.c,v 1.4 2005/12/11 12:19:08 christos Exp $      */
+/*     $NetBSD: procfs_machdep.c,v 1.5 2014/04/05 18:44:32 christos Exp $      */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.4 2005/12/11 12:19:08 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.5 2014/04/05 18:44:32 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -15,7 +15,7 @@
  * Only used when procfs is mounted with -o linux.
  */
 int
-procfs_getcpuinfstr(char *buf, int *len)
+procfs_getcpuinfstr(char *buf, size_t *len)
 {
        *len = 0;
 
diff -r 4c5c71c9c72e -r 0289d55bdf19 sys/arch/sparc64/sparc64/procfs_machdep.c
--- a/sys/arch/sparc64/sparc64/procfs_machdep.c Sat Apr 05 18:43:09 2014 +0000
+++ b/sys/arch/sparc64/sparc64/procfs_machdep.c Sat Apr 05 18:44:32 2014 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: procfs_machdep.c,v 1.5 2005/12/11 12:19:15 christos Exp $      */
+/*     $NetBSD: procfs_machdep.c,v 1.6 2014/04/05 18:44:32 christos Exp $      */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.5 2005/12/11 12:19:15 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.6 2014/04/05 18:44:32 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -15,7 +15,7 @@
  * Only used when procfs is mounted with -o linux.
  */
 int
-procfs_getcpuinfstr(char *sbuf, int *len)
+procfs_getcpuinfstr(char *sbuf, size_t *len)
 {
        *len = 0;
 
diff -r 4c5c71c9c72e -r 0289d55bdf19 sys/arch/usermode/usermode/procfs_machdep.c
--- a/sys/arch/usermode/usermode/procfs_machdep.c       Sat Apr 05 18:43:09 2014 +0000
+++ b/sys/arch/usermode/usermode/procfs_machdep.c       Sat Apr 05 18:44:32 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: procfs_machdep.c,v 1.3 2011/12/15 01:30:04 jmcneill Exp $ */
+/* $NetBSD: procfs_machdep.c,v 1.4 2014/04/05 18:44:32 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: procfs_machdep.c,v 1.3 2011/12/15 01:30:04 jmcneill Exp $");
+__RCSID("$NetBSD: procfs_machdep.c,v 1.4 2014/04/05 18:44:32 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -38,7 +38,7 @@
 #include <machine/thunk.h>
 
 int
-procfs_getcpuinfstr(char *bf, int *len)
+procfs_getcpuinfstr(char *bf, size_t *len)
 {
        return thunk_getcpuinfo(bf, len);
 }
diff -r 4c5c71c9c72e -r 0289d55bdf19 sys/arch/vax/vax/procfs_machdep.c
--- a/sys/arch/vax/vax/procfs_machdep.c Sat Apr 05 18:43:09 2014 +0000
+++ b/sys/arch/vax/vax/procfs_machdep.c Sat Apr 05 18:44:32 2014 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: procfs_machdep.c,v 1.4 2005/12/11 12:19:36 christos Exp $      */
+/*     $NetBSD: procfs_machdep.c,v 1.5 2014/04/05 18:44:32 christos Exp $      */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.4 2005/12/11 12:19:36 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.5 2014/04/05 18:44:32 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -15,7 +15,7 @@
  * Only used when procfs is mounted with -o linux.
  */
 int
-procfs_getcpuinfstr(char *buf, int *len)
+procfs_getcpuinfstr(char *buf, size_t *len)
 {
        *len = 0;
 



Home | Main Index | Thread Index | Old Index