Source-Changes-HG archive

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

[src/pgoyette-compat]: src/sys/compat Merge changes from HEAD into ccd_60.c



details:   https://anonhg.NetBSD.org/src/rev/9657b7daaf14
branches:  pgoyette-compat
changeset: 321068:9657b7daaf14
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sun Mar 18 23:34:25 2018 +0000

description:
Merge changes from HEAD into ccd_60.c

For all of the individual xxx_60_{init,fini} routines, don't force
them to artificially return a status;  just make them void.  This
simplifies the compat_60_{init,fini} handling of errors that remain.

diffstat:

 sys/compat/common/ccd_60.c        |  22 +++++---------
 sys/compat/common/compat_60_mod.c |  55 +++++++-------------------------------
 sys/compat/common/compat_mod.h    |   6 ++--
 sys/compat/common/kern_cpu_60.c   |  10 ++----
 sys/compat/common/tty_60.c        |  11 ++----
 sys/compat/sys/cpuio.h            |   6 ++--
 6 files changed, 32 insertions(+), 78 deletions(-)

diffs (295 lines):

diff -r ba2938cc51a0 -r 9657b7daaf14 sys/compat/common/ccd_60.c
--- a/sys/compat/common/ccd_60.c        Sun Mar 18 22:49:26 2018 +0000
+++ b/sys/compat/common/ccd_60.c        Sun Mar 18 23:34:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ccd_60.c,v 1.1.2.3 2018/03/18 22:49:26 pgoyette Exp $  */
+/*     $NetBSD: ccd_60.c,v 1.1.2.4 2018/03/18 23:34:25 pgoyette Exp $  */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -26,7 +26,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ccd_60.c,v 1.1.2.3 2018/03/18 22:49:26 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ccd_60.c,v 1.1.2.4 2018/03/18 23:34:25 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -50,10 +50,8 @@
     int (*f)(dev_t, u_long, void *, int, struct lwp *))
 {
        switch (cmd) {
-#if defined(COMPAT_60) && !defined(_LP64)
+#ifdef CCDIOCSET_60
        case CCDIOCSET_60: {
-               int error;
-
                if (data == NULL)
                        return 0;
                
@@ -65,7 +63,7 @@
                ccio.ccio_ileave = ccio60->ccio_ileave;
                ccio.ccio_flags = ccio60->ccio_flags;
                ccio.ccio_unit = ccio60->ccio_unit;
-               error = (*f)(dev, CCDIOCSET, &ccio, flag, l);
+               int error = (*f)(dev, CCDIOCSET, &ccio, flag, l);
                if (!error) {
                        /* Copy data back, adjust types if necessary */
                        ccio60->ccio_disks = ccio.ccio_disks;
@@ -79,31 +77,27 @@
        }
 
        case CCDIOCCLR_60:
-               int error;
-
                if (data == NULL)
                        return ENOSYS;
                /*
                 * ccio_size member not used, so existing struct OK
                 * drop through to existing non-compat version
                 */
-               return (*f)(dev, CCDIOCLR, data, flag, l);
-#endif /* COMPAT_60 && !_LP64*/
+               return (*f)(dev, CCDIOCCLR, data, flag, l);
+#endif
        default:
                return ENOSYS;
        }
 }
 
-int
+void
 ccd_60_init(void)
 {
        compat_ccd_ioctl_60 = compat_60_ccdioctl;
-       return 0;
 }
 
-int
+void
 ccd_60_fini(void)
 {
        compat_ccd_ioctl_60 = (void *)enosys;
-       return 0;
 }
diff -r ba2938cc51a0 -r 9657b7daaf14 sys/compat/common/compat_60_mod.c
--- a/sys/compat/common/compat_60_mod.c Sun Mar 18 22:49:26 2018 +0000
+++ b/sys/compat/common/compat_60_mod.c Sun Mar 18 23:34:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_60_mod.c,v 1.1.2.9 2018/03/18 21:41:31 pgoyette Exp $   */
+/*     $NetBSD: compat_60_mod.c,v 1.1.2.10 2018/03/18 23:34:25 pgoyette Exp $  */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_60_mod.c,v 1.1.2.9 2018/03/18 21:41:31 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_60_mod.c,v 1.1.2.10 2018/03/18 23:34:25 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -51,6 +51,7 @@
 #include <compat/common/compat_util.h>
 #include <compat/common/compat_mod.h>
 
+#include <compat/sys/ccdvar.h>
 #include <compat/sys/cpuio.h>
 
 #define REQUIRED_60 "compat_70"                /* XXX No compat_80 yet */
@@ -71,30 +72,10 @@
                return 0;
        }
 
-       error = kern_tty_60_init();
-       if (error != 0) {
-               kern_sa_60_fini();
-               kern_time_60_fini();
-               return 0;
-       }
-
-       error = ccd_60_init();
-       if (error != 0) {
-               kern_tty_60_fini();
-               kern_sa_60_fini();
-               kern_time_60_fini();
-               return 0;
-       }
-
+       kern_tty_60_init();
+       ccd_60_init();
 #ifdef CPU_UCODE
-       error = kern_cpu_60_init();
-       if (error != 0) {
-               ccd_60_fini();
-               kern_tty_60_fini();
-               kern_sa_60_fini();
-               kern_time_60_fini();
-               return 0;
-       }
+       kern_cpu_60_init();
 #endif
 
        return error;
@@ -106,27 +87,11 @@
        int error = 0;
 
 #ifdef CPU_UCODE
-       error = kern_cpu_60_fini();
-       if (error != 0)
-               return error;
-#endif
-
-       error = ccd_60_fini():
-       if (error != 0) {
-#ifdef CPU_UCODE
-               kern_cpu_60_init();
-               return error;
+       kern_cpu_60_fini();
 #endif
-       }
+       ccd_60_fini();
+       kern_tty_60_fini();
 
-       error = kern_tty_60_fini();
-       if (error != 0) {
-               ccd_60_init();
-#ifdef CPU_UCODE
-               kern_cpu_60_init();
-#endif
-               return error;
-       }
 
        error = kern_sa_60_fini();
        if (error != 0) {
@@ -140,8 +105,8 @@
 
        error = kern_time_60_fini();
        if (error != 0) {
+               kern_sa_60_init();
                kern_tty_60_init();
-               kern_sa_60_init();
                ccd_60_init();
 #ifdef CPU_UCODE
                kern_cpu_60_init();
diff -r ba2938cc51a0 -r 9657b7daaf14 sys/compat/common/compat_mod.h
--- a/sys/compat/common/compat_mod.h    Sun Mar 18 22:49:26 2018 +0000
+++ b/sys/compat/common/compat_mod.h    Sun Mar 18 23:34:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_mod.h,v 1.1.42.5 2018/03/18 09:00:55 pgoyette Exp $     */
+/*     $NetBSD: compat_mod.h,v 1.1.42.6 2018/03/18 23:34:25 pgoyette Exp $     */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -52,8 +52,8 @@
 int kern_time_60_fini(void);
 int kern_sa_60_init(void);
 int kern_sa_60_fini(void);
-int kern_tty_60_init(void);
-int kern_tty_60_fini(void);
+void kern_tty_60_init(void);
+void kern_tty_60_fini(void);
 #endif
 
 #endif /* !_COMPAT_MOD_H_ */
diff -r ba2938cc51a0 -r 9657b7daaf14 sys/compat/common/kern_cpu_60.c
--- a/sys/compat/common/kern_cpu_60.c   Sun Mar 18 22:49:26 2018 +0000
+++ b/sys/compat/common/kern_cpu_60.c   Sun Mar 18 23:34:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_cpu_60.c,v 1.1.2.4 2018/03/18 09:00:55 pgoyette Exp $     */
+/*     $NetBSD: kern_cpu_60.c,v 1.1.2.5 2018/03/18 23:34:25 pgoyette Exp $     */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_cpu_60.c,v 1.1.2.4 2018/03/18 09:00:55 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_cpu_60.c,v 1.1.2.5 2018/03/18 23:34:25 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_cpu_ucode.h"
@@ -71,18 +71,16 @@
        }
 }
 
-int
+void
 kern_cpu_60_init(void)
 {
 
        compat_cpuctl_ioctl = compat6_cpuctl_ioctl;
-       return 0;
 }
 
-int
+void
 kern_cpu_60_fini(void)
 {
 
        compat_cpuctl_ioctl = (void *)enosys;
-       return 0;
 }
diff -r ba2938cc51a0 -r 9657b7daaf14 sys/compat/common/tty_60.c
--- a/sys/compat/common/tty_60.c        Sun Mar 18 22:49:26 2018 +0000
+++ b/sys/compat/common/tty_60.c        Sun Mar 18 23:34:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty_60.c,v 1.4.16.2 2018/03/18 12:06:59 pgoyette Exp $ */
+/*     $NetBSD: tty_60.c,v 1.4.16.3 2018/03/18 23:34:25 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tty_60.c,v 1.4.16.2 2018/03/18 12:06:59 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_60.c,v 1.4.16.3 2018/03/18 23:34:25 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -117,20 +117,17 @@
        }
 }
 
-int
+void
 kern_tty_60_init(void)
 {
 
        vec_compat_ttioctl_60 = compat_60_ttioctl;
 /*     vec_compat_ptmioctl_60 = compat_60_ptmioctl;    XXX NOT-YET */
-       return 0;
 }
 
-int
+void
 kern_tty_60_fini(void)
 {
        vec_compat_ttioctl_60 = NULL;
 /*     vec_compat_ptmioctl_60 = NULL;                  XXX NOT-YET */
-
-       return 0;
 }
diff -r ba2938cc51a0 -r 9657b7daaf14 sys/compat/sys/cpuio.h
--- a/sys/compat/sys/cpuio.h    Sun Mar 18 22:49:26 2018 +0000
+++ b/sys/compat/sys/cpuio.h    Sun Mar 18 23:34:25 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuio.h,v 1.5.16.4 2018/03/18 09:00:55 pgoyette Exp $ */
+/* $NetBSD: cpuio.h,v 1.5.16.5 2018/03/18 23:34:25 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
 #define OIOC_CPU_UCODE_GET_VERSION      _IOR('c', 4, struct compat6_cpu_ucode)
 #define OIOC_CPU_UCODE_APPLY            _IOW('c', 5, struct compat6_cpu_ucode)
 
-int kern_cpu_60_init(void);
-int kern_cpu_60_fini(void);
+void kern_cpu_60_init(void);
+void kern_cpu_60_fini(void);
 
 #endif /* _COMPAT_SYS_CPUIO_H */



Home | Main Index | Thread Index | Old Index