Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/luna68k/dev KNF, use uintNN_t, tab/space cosmetics ...



details:   https://anonhg.NetBSD.org/src/rev/dc2c8d4092a4
branches:  trunk
changeset: 767688:dc2c8d4092a4
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Wed Jul 27 14:17:54 2011 +0000

description:
KNF, use uintNN_t, tab/space cosmetics etc.

diffstat:

 sys/arch/luna68k/dev/lunafb.c     |  99 +++++++++++++++++++-------------------
 sys/arch/luna68k/dev/lunaws.c     |  34 +++++++------
 sys/arch/luna68k/dev/omrasops.c   |  43 ++++++++--------
 sys/arch/luna68k/dev/sio.c        |   9 ++-
 sys/arch/luna68k/dev/sioreg.h     |   6 +-
 sys/arch/luna68k/dev/siotty.c     |  51 ++++++++++++-------
 sys/arch/luna68k/dev/siovar.h     |  10 +-
 sys/arch/luna68k/dev/spc.c        |   6 +-
 sys/arch/luna68k/dev/timekeeper.c |  18 +++---
 9 files changed, 145 insertions(+), 131 deletions(-)

diffs (truncated from 877 to 300 lines):

diff -r c7ef8aaa1895 -r dc2c8d4092a4 sys/arch/luna68k/dev/lunafb.c
--- a/sys/arch/luna68k/dev/lunafb.c     Wed Jul 27 13:45:49 2011 +0000
+++ b/sys/arch/luna68k/dev/lunafb.c     Wed Jul 27 14:17:54 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lunafb.c,v 1.24 2011/07/27 11:54:40 tsutsui Exp $ */
+/* $NetBSD: lunafb.c,v 1.25 2011/07/27 14:17:54 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lunafb.c,v 1.24 2011/07/27 11:54:40 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lunafb.c,v 1.25 2011/07/27 14:17:54 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -58,19 +58,19 @@
 #include "ioconf.h"
 
 struct bt454 {
-       volatile u_int8_t bt_addr;      /* map address register */
-       volatile u_int8_t bt_cmap;      /* colormap data register */
+       volatile uint8_t bt_addr;       /* map address register */
+       volatile uint8_t bt_cmap;       /* colormap data register */
 };
 
 struct bt458 {
-       volatile u_int8_t bt_addr;      /* map address register */
-               unsigned :24;
-       volatile u_int8_t bt_cmap;      /* colormap data register */
-               unsigned :24;
-       volatile u_int8_t bt_ctrl;      /* control register */
-               unsigned :24;
-       volatile u_int8_t bt_omap;      /* overlay (cursor) map register */
-               unsigned :24;
+       volatile uint8_t bt_addr;       /* map address register */
+       uint8_t          pad0[3];
+       volatile uint8_t bt_cmap;       /* colormap data register */
+       uint8_t          pad1[3];
+       volatile uint8_t bt_ctrl;       /* control register */
+       uint8_t          pad2[3];
+       volatile uint8_t bt_omap;       /* overlay (cursor) map register */
+       uint8_t          pad3[3];
 };
 
 #define        OMFB_RFCNT      0xB1000000      /* video h-origin/v-origin */
@@ -94,9 +94,9 @@
 
 struct hwcmap {
 #define CMAP_SIZE 256
-       u_int8_t r[CMAP_SIZE];
-       u_int8_t g[CMAP_SIZE];
-       u_int8_t b[CMAP_SIZE];
+       uint8_t r[CMAP_SIZE];
+       uint8_t g[CMAP_SIZE];
+       uint8_t b[CMAP_SIZE];
 };
 
 struct omfb_softc {
@@ -129,14 +129,13 @@
        sizeof(_omfb_scrlist) / sizeof(struct wsscreen_descr *), _omfb_scrlist
 };
 
-static int   omfbioctl(void *, void *, u_long, void *, int,
-                           struct lwp *);
+static int   omfbioctl(void *, void *, u_long, void *, int, struct lwp *);
 static paddr_t omfbmmap(void *, void *, off_t, int);
 static int   omfb_alloc_screen(void *, const struct wsscreen_descr *,
-                                     void **, int *, int *, long *);
+                              void **, int *, int *, long *);
 static void  omfb_free_screen(void *, void *);
 static int   omfb_show_screen(void *, void *, int,
-                               void (*) (void *, int, int), void *);
+                             void (*) (void *, int, int), void *);
 
 static const struct wsdisplay_accessops omfb_accessops = {
        omfbioctl,
@@ -164,15 +163,15 @@
        struct mainbus_attach_args *ma = aux;
 
        if (strcmp(ma->ma_name, fb_cd.cd_name))
-               return (0);
+               return 0;
 #if 0  /* XXX badaddr() bombs if no framebuffer is installed */
        if (badaddr((void *)ma->ma_addr, 4))
-               return (0);
+               return 0;
 #else
        if (hwplanemask == 0)
-               return (0);
+               return 0;
 #endif
-       return (1);
+       return 1;
 }
 
 static void
@@ -186,10 +185,9 @@
        if (omfb_console) {
                sc->sc_dc = &omfb_console_dc;
                sc->nscreens = 1;
-       }
-       else {
-               sc->sc_dc = (struct om_hwdevconfig *)
-                   malloc(sizeof(struct om_hwdevconfig), M_DEVBUF, M_WAITOK);
+       } else {
+               sc->sc_dc = malloc(sizeof(struct om_hwdevconfig),
+                   M_DEVBUF, M_WAITOK);
                omfb_getdevconfig(OMFB_FB_WADDR, sc->sc_dc);
        }
        aprint_normal(": %d x %d, %dbpp\n", sc->sc_dc->dc_wid, sc->sc_dc->dc_ht,
@@ -217,7 +215,7 @@
        (*omfb_emulops.allocattr)(&dc->dc_rcons, 0, 0, 0, &defattr);
        wsdisplay_cnattach(&omfb_stdscreen, &dc->dc_rcons, 0, 0, defattr);
        omfb_console = 1;
-       return (0);
+       return 0;
 }
 
 static int
@@ -229,7 +227,7 @@
        switch (cmd) {
        case WSDISPLAYIO_GTYPE:
                *(u_int *)data = WSDISPLAY_TYPE_LUNA;
-               return (0);
+               return 0;
 
        case WSDISPLAYIO_GINFO:
 #define        wsd_fbip ((struct wsdisplay_fbinfo *)data)
@@ -238,7 +236,7 @@
                wsd_fbip->depth = dc->dc_depth;
                wsd_fbip->cmsize = dc->dc_cmsize;
 #undef fbt
-               return (0);
+               return 0;
 
        case WSDISPLAYIO_LINEBYTES:
                *(u_int *)data = dc->dc_rowbytes;
@@ -259,7 +257,7 @@
        case WSDISPLAYIO_SCURSOR:
                break;
        }
-       return (EPASSTHROUGH);
+       return EPASSTHROUGH;
 }
 
 /*
@@ -292,7 +290,7 @@
 
        cmsize = sc->sc_dc->dc_cmsize;
        if (index >= cmsize || count > cmsize - index)
-               return (EINVAL);
+               return EINVAL;
 
        error = copyout(&sc->sc_cmap.r[index], p->red, count);
        if (error)
@@ -336,8 +334,7 @@
                        odac->bt_cmap = sc->sc_cmap.g[i];
                        odac->bt_cmap = sc->sc_cmap.b[i];
                }
-       }
-       else if (hwplanemask == 0xff) {
+       } else if (hwplanemask == 0xff) {
                struct bt458 *ndac = (struct bt458 *)OMFB_RAMDAC;
                ndac->bt_addr = index;
                for (i = index; i < index + count; i++) {
@@ -346,7 +343,7 @@
                        ndac->bt_cmap = sc->sc_cmap.b[i];
                }
        }
-       return (0);
+       return 0;
 }
 
 static void
@@ -357,7 +354,7 @@
        struct rcons *rcp;
        union {
                struct { short h, v; } p;
-               u_int32_t u;
+               uint32_t u;
        } rfcnt;
 
        switch (hwplanemask) {
@@ -399,8 +396,7 @@
                        odac->bt_cmap = 255;
                        odac->bt_cmap = 255;
                }
-       }
-       else if (hwplanemask == 0xff) {
+       } else if (hwplanemask == 0xff) {
                struct bt458 *ndac = (struct bt458 *)OMFB_RAMDAC;
 
                ndac->bt_addr = 0x04;
@@ -423,22 +419,22 @@
        rfcnt.p.h = 7;
        rfcnt.p.v = -27;
        /* single write of 0x007ffe6 */
-       *(volatile u_int32_t *)OMFB_RFCNT = rfcnt.u;
+       *(volatile uint32_t *)OMFB_RFCNT = rfcnt.u;
 
        /* clear the screen */
-       *(volatile u_int32_t *)OMFB_PLANEMASK = 0xff;
-       ((volatile u_int32_t *)OMFB_ROPFUNC)[5] = ~0;   /* ROP copy */
-       for (i = 0; i < dc->dc_ht * dc->dc_rowbytes/sizeof(u_int32_t); i++)
-               *((volatile u_int32_t *)dc->dc_videobase + i) = 0;
-       *(volatile u_int32_t *)OMFB_PLANEMASK = 0x01;
+       *(volatile uint32_t *)OMFB_PLANEMASK = 0xff;
+       ((volatile uint32_t *)OMFB_ROPFUNC)[5] = ~0;    /* ROP copy */
+       for (i = 0; i < dc->dc_ht * dc->dc_rowbytes/sizeof(uint32_t); i++)
+               *((volatile uint32_t *)dc->dc_videobase + i) = 0;
+       *(volatile uint32_t *)OMFB_PLANEMASK = 0x01;
 
        /* initialize the raster */
        rap = &dc->dc_raster;
        rap->width = dc->dc_wid;
        rap->height = dc->dc_ht;
        rap->depth = dc->dc_depth;
-       rap->linelongs = dc->dc_rowbytes / sizeof(u_int32_t);
-       rap->pixels = (u_int32_t *)dc->dc_videobase;
+       rap->linelongs = dc->dc_rowbytes / sizeof(uint32_t);
+       rap->pixels = (uint32_t *)dc->dc_videobase;
 
        /* initialize the raster console blitter */
        rcp = &dc->dc_rcons;
@@ -453,13 +449,14 @@
 }
 
 static int
-omfb_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep, int *curxp, int *curyp, long *attrp)
+omfb_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep,
+    int *curxp, int *curyp, long *attrp)
 {
        struct omfb_softc *sc = v;
        long defattr;
 
        if (sc->nscreens > 0)
-               return (ENOMEM);
+               return ENOMEM;
 
        *cookiep = &sc->sc_dc->dc_rcons; /* one and only for now */
        *curxp = 0;
@@ -467,7 +464,7 @@
        (*omfb_emulops.allocattr)(&sc->sc_dc->dc_rcons, 0, 0, 0, &defattr);
        *attrp = defattr;
        sc->nscreens++;
-       return (0);
+       return 0;
 }
 
 static void
@@ -482,7 +479,9 @@
 }
 
 static int
-omfb_show_screen(void *v, void *cookie, int waitok, void (*cb)(void *, int, int), void *cbarg)
+omfb_show_screen(void *v, void *cookie, int waitok,
+    void (*cb)(void *, int, int), void *cbarg)
 {
+
        return 0;
 }
diff -r c7ef8aaa1895 -r dc2c8d4092a4 sys/arch/luna68k/dev/lunaws.c
--- a/sys/arch/luna68k/dev/lunaws.c     Wed Jul 27 13:45:49 2011 +0000
+++ b/sys/arch/luna68k/dev/lunaws.c     Wed Jul 27 14:17:54 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lunaws.c,v 1.22 2011/07/27 11:54:40 tsutsui Exp $ */
+/* $NetBSD: lunaws.c,v 1.23 2011/07/27 14:17:54 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lunaws.c,v 1.22 2011/07/27 11:54:40 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lunaws.c,v 1.23 2011/07/27 14:17:54 tsutsui Exp $");
 
 #include "wsmouse.h"
 
@@ -51,7 +51,7 @@
 
 #include "ioconf.h"
 
-static const u_int8_t ch1_regs[6] = {
+static const uint8_t ch1_regs[6] = {
        WR0_RSTINT,                             /* Reset E/S Interrupt */
        WR1_RXALLS,                             /* Rx per char, No Tx */
        0,                                      /* */
@@ -63,7 +63,7 @@
 struct ws_softc {
        device_t        sc_dev;
        struct sioreg   *sc_ctl;
-       u_int8_t        sc_wr[6];
+       uint8_t         sc_wr[6];
        struct device   *sc_wskbddev;
 #if NWSMOUSE > 0
        struct device   *sc_wsmousedev;



Home | Main Index | Thread Index | Old Index