Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/next68k Misc KNF and cosmetics.



details:   https://anonhg.NetBSD.org/src/rev/bf5be95fd6df
branches:  trunk
changeset: 373345:bf5be95fd6df
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Feb 03 23:13:00 2023 +0000

description:
Misc KNF and cosmetics.

diffstat:

 sys/arch/next68k/dev/intio.c          |   22 +--
 sys/arch/next68k/dev/nextcons.c       |   20 ++-
 sys/arch/next68k/dev/nextdisplay.c    |   69 +++++++-------
 sys/arch/next68k/dev/nextdisplayvar.h |   22 ++--
 sys/arch/next68k/dev/nextkbd.c        |  156 ++++++++++++++++---------------
 sys/arch/next68k/include/bus_space.h  |    4 +-
 sys/arch/next68k/next68k/autoconf.c   |   40 ++++----
 sys/arch/next68k/next68k/clock.c      |   15 +-
 sys/arch/next68k/next68k/disksubr.c   |  147 +++++++++++++++--------------
 sys/arch/next68k/next68k/locore.s     |   16 +-
 sys/arch/next68k/next68k/rtc.c        |  165 ++++++++++++++++++---------------
 sys/arch/next68k/next68k/trap.c       |    8 +-
 sys/arch/next68k/next68k/vectors.s    |    8 +-
 13 files changed, 358 insertions(+), 334 deletions(-)

diffs (truncated from 1769 to 300 lines):

diff -r cba324800649 -r bf5be95fd6df sys/arch/next68k/dev/intio.c
--- a/sys/arch/next68k/dev/intio.c      Fri Feb 03 23:07:47 2023 +0000
+++ b/sys/arch/next68k/dev/intio.c      Fri Feb 03 23:13:00 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intio.c,v 1.16 2021/08/07 16:19:01 thorpej Exp $       */
+/*     $NetBSD: intio.c,v 1.17 2023/02/03 23:13:00 tsutsui Exp $       */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intio.c,v 1.16 2021/08/07 16:19:01 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intio.c,v 1.17 2023/02/03 23:13:00 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -53,12 +53,6 @@
 CFATTACH_DECL_NEW(intio, 0,
     intiomatch, intioattach, NULL, NULL);
 
-#if 0
-struct cfdriver intio_cd = {
-       NULL, "intio", DV_DULL
-};
-#endif
-
 static bool intio_attached;
 
 int
@@ -66,9 +60,9 @@
 {
        /* Allow only one instance. */
        if (intio_attached)
-               return (0);
+               return 0;
 
-       return (1);
+       return 1;
 }
 
 void
@@ -92,24 +86,24 @@
        if (ia->ia_addr)
                aprint_normal(" addr %p", ia->ia_addr);
 
-       return (UNCONF);
+       return UNCONF;
 }
 
 int
 intiosearch(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
 {
-       struct mainbus_attach_args *mba = (struct mainbus_attach_args *) aux;
+       struct mainbus_attach_args *mba = aux;
        struct intio_attach_args ia;
 
        do {
                ia.ia_addr = NULL;
                ia.ia_bst = NEXT68K_INTIO_BUS_SPACE;
                ia.ia_dmat = mba->mba_dmat;
-               
+
                if (!config_probe(parent, cf, &ia))
                        break;
                config_attach(parent, cf, &ia, intioprint, CFARGS_NONE);
        } while (cf->cf_fstate == FSTATE_STAR);
 
-       return (0);
+       return 0;
 }
diff -r cba324800649 -r bf5be95fd6df sys/arch/next68k/dev/nextcons.c
--- a/sys/arch/next68k/dev/nextcons.c   Fri Feb 03 23:07:47 2023 +0000
+++ b/sys/arch/next68k/dev/nextcons.c   Fri Feb 03 23:13:00 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nextcons.c,v 1.11 2010/04/24 19:58:13 dbj Exp $        */
+/*     $NetBSD: nextcons.c,v 1.12 2023/02/03 23:13:00 tsutsui Exp $    */
 
 /*
  * Copyright (c) 1999 Darrin B. Jewell
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nextcons.c,v 1.11 2010/04/24 19:58:13 dbj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nextcons.c,v 1.12 2023/02/03 23:13:00 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -63,11 +63,11 @@
 nextcnprobe(struct consdev *cp)
 {
 
-       if ((rom_machine_type == NeXT_WARP9)
-           || (rom_machine_type == NeXT_X15)
-           || (rom_machine_type == NeXT_WARP9C)
-           || (rom_machine_type == NeXT_TURBO_MONO)
-           || (rom_machine_type == NeXT_TURBO_COLOR))
+       if (rom_machine_type == NeXT_WARP9 ||
+           rom_machine_type == NeXT_X15 ||
+           rom_machine_type == NeXT_WARP9C ||
+           rom_machine_type == NeXT_TURBO_MONO ||
+           rom_machine_type == NeXT_TURBO_COLOR)
                cp->cn_pri = CN_INTERNAL;
        else 
                cp->cn_pri = CN_DEAD;
@@ -78,6 +78,7 @@
 void
 nextcninit(struct consdev *cp)
 {
+
        nextkbd_cnattach(NEXT68K_INTIO_BUS_SPACE);
        nextdisplay_cnattach();
 }
@@ -85,17 +86,20 @@
 int
 nextcngetc (dev_t dev)
 {
+
        return wskbd_cngetc(dev);
 }
 
 void
 nextcnputc(dev_t dev, int c)
 {
-       wsdisplay_cnputc(dev,c);        
+
+       wsdisplay_cnputc(dev,c);
 }
 
 void
 nextcnpollc(dev_t dev, int on)
 {
+
        wskbd_cnpollc(dev,on);
 }
diff -r cba324800649 -r bf5be95fd6df sys/arch/next68k/dev/nextdisplay.c
--- a/sys/arch/next68k/dev/nextdisplay.c        Fri Feb 03 23:07:47 2023 +0000
+++ b/sys/arch/next68k/dev/nextdisplay.c        Fri Feb 03 23:13:00 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nextdisplay.c,v 1.25 2021/08/07 16:19:01 thorpej Exp $ */
+/* $NetBSD: nextdisplay.c,v 1.26 2023/02/03 23:13:00 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1998 Matt DeBergalis
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nextdisplay.c,v 1.25 2021/08/07 16:19:01 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nextdisplay.c,v 1.26 2023/02/03 23:13:00 tsutsui Exp $");
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
@@ -136,8 +136,8 @@
 static int
 nextdisplay_is_console(vaddr_t addr)
 {
-       return (nextdisplay_console_dc.isconsole
-                       && (addr == nextdisplay_consaddr));
+       return nextdisplay_console_dc.isconsole &&
+           addr == nextdisplay_consaddr;
 }
 
 int
@@ -148,9 +148,9 @@
            rom_machine_type == NeXT_WARP9C ||
            rom_machine_type == NeXT_TURBO_MONO ||
            rom_machine_type == NeXT_TURBO_COLOR)
-               return (1);
-       else 
-               return (0);
+               return 1;
+       else
+               return 0;
 }
 
 void
@@ -174,7 +174,7 @@
 
        dc->dc_wid = 1120;
        dc->dc_ht = 832;
-       dc->dc_depth = color ? 16 : 2; 
+       dc->dc_depth = color ? 16 : 2;
        dc->dc_rowbytes = (turbo ? 1120 : 1152) * dc->dc_depth / 8;
 
        dc->dc_videobase = dc->dc_vaddr;
@@ -198,15 +198,15 @@
 
        /* clear the screen */
        for (i = 0; i < dc->dc_ht * dc->dc_rowbytes; i += sizeof(u_int32_t))
-               *(u_int32_t *)(dc->dc_videobase + i) = 
-                       (color ? 0x0 : 0xffffffff);
+               *(uint32_t *)(dc->dc_videobase + i) =
+                   color ? 0x0 : 0xffffffff;
 
        rap = &dc->dc_raster;
        rap->width = dc->dc_wid;
        rap->height = dc->dc_ht;
        rap->depth = color ? 16 : 2;
        rap->linelongs = dc->dc_rowbytes / sizeof(u_int32_t);
-       rap->pixels = (u_int32_t *)dc->dc_videobase;
+       rap->pixels = (uint32_t *)dc->dc_videobase;
 
        /* initialize the raster console blitter */
        rcp = &dc->dc_rcons;
@@ -217,11 +217,11 @@
        rcons_init(rcp, 34, 80);
 
        if (color) {
-               nextdisplay_color.nrows = dc->dc_rcons.rc_maxrow; 
-               nextdisplay_color.ncols = dc->dc_rcons.rc_maxcol; 
+               nextdisplay_color.nrows = dc->dc_rcons.rc_maxrow;
+               nextdisplay_color.ncols = dc->dc_rcons.rc_maxcol;
        } else {
-               nextdisplay_mono.nrows = dc->dc_rcons.rc_maxrow; 
-               nextdisplay_mono.ncols = dc->dc_rcons.rc_maxcol; 
+               nextdisplay_mono.nrows = dc->dc_rcons.rc_maxrow;
+               nextdisplay_mono.ncols = dc->dc_rcons.rc_maxcol;
        }
 }
 
@@ -246,7 +246,7 @@
        }
 
        isconsole = nextdisplay_is_console(addr);
-                               
+
        if (isconsole) {
                sc->sc_dc = &nextdisplay_console_dc;
                sc->nscreens = 1;
@@ -257,7 +257,7 @@
        }
 
        printf(": %d x %d, %dbpp\n", sc->sc_dc->dc_wid, sc->sc_dc->dc_ht,
-              sc->sc_dc->dc_depth);
+           sc->sc_dc->dc_depth);
 
        if (iscolor) {
 #if 0
@@ -267,13 +267,15 @@
                aprint_debug_dev(sc->sc_dev, "cmd=%02x\n", x);
 #endif
                *(volatile uint8_t *)IIOV(NEXT_P_C16_CMD_REG) = 0x05;
-               isrlink_autovec(nextdisplay_intr, sc, NEXT_I_IPL(NEXT_I_C16_VIDEO), 1, NULL);
+               isrlink_autovec(nextdisplay_intr, sc,
+                   NEXT_I_IPL(NEXT_I_C16_VIDEO), 1, NULL);
                INTR_ENABLE(NEXT_I_C16_VIDEO);
        }
 
        /* initialize the raster */
        waa.console = isconsole;
-       waa.scrdata = iscolor ? &nextdisplay_screenlist_color : &nextdisplay_screenlist_mono;
+       waa.scrdata = iscolor ?
+           &nextdisplay_screenlist_color : &nextdisplay_screenlist_mono;
        waa.accessops = &nextdisplay_accessops;
        waa.accesscookie = sc;
 #if 0
@@ -290,18 +292,18 @@
 #endif
 
        if (!INTR_OCCURRED(NEXT_I_C16_VIDEO))
-               return (0);
+               return 0;
 #if 0
        x = *(volatile uint8_t *)IIOV(NEXT_P_C16_CMD_REG);
        printf("I%02x", x);
 #endif
        *(volatile uint8_t *)IIOV(NEXT_P_C16_CMD_REG) = 0x05;
-       return (1);
+       return 1;
 }
 
 int
 nextdisplay_ioctl(void *v, void *vs, u_long cmd, void *data, int flag,
-       struct lwp *l)
+    struct lwp *l)
 {
        struct nextdisplay_softc *sc = v;
        struct nextdisplay_config *dc = sc->sc_dc;
@@ -352,21 +354,19 @@
 
        /* only allow one screen */
        if (sc->nscreens > 0)
-               return (ENOMEM);
+               return ENOMEM;
 
        *cookiep = &sc->sc_dc->dc_rcons; /* one and only for now */
        *curxp = 0;
        *curyp = 0;
-       rcons_allocattr(&sc->sc_dc->dc_rcons, 0, 0, 
-                       (strcmp(type->name, "color") == 0) 
-                       ? 0 
-                       : WSATTR_REVERSE, &defattr);
+       rcons_allocattr(&sc->sc_dc->dc_rcons, 0, 0,
+           (strcmp(type->name, "color") == 0) ? 0 : WSATTR_REVERSE, &defattr);
        *defattrp = defattr;
        sc->nscreens++;
 #if 0



Home | Main Index | Thread Index | Old Index