Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x68k/stand/libsa Some KNF. No binary change.



details:   https://anonhg.NetBSD.org/src/rev/195aacddf4c9
branches:  trunk
changeset: 764103:195aacddf4c9
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Mon Apr 11 14:00:02 2011 +0000

description:
Some KNF. No binary change.

diffstat:

 sys/arch/x68k/stand/libsa/chdsk.c   |   3 ++-
 sys/arch/x68k/stand/libsa/consio.c  |  27 +++++++++++++++------------
 sys/arch/x68k/stand/libsa/consio.h  |  10 +++++-----
 sys/arch/x68k/stand/libsa/devopen.c |   8 ++++----
 sys/arch/x68k/stand/libsa/fd.c      |   4 ++--
 sys/arch/x68k/stand/libsa/sdcd.c    |  10 ++++++----
 sys/arch/x68k/stand/libsa/sdcdvar.h |   6 +++---
 7 files changed, 37 insertions(+), 31 deletions(-)

diffs (242 lines):

diff -r 14f6b5f7031d -r 195aacddf4c9 sys/arch/x68k/stand/libsa/chdsk.c
--- a/sys/arch/x68k/stand/libsa/chdsk.c Mon Apr 11 13:49:41 2011 +0000
+++ b/sys/arch/x68k/stand/libsa/chdsk.c Mon Apr 11 14:00:02 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: chdsk.c,v 1.3 2011/04/07 13:38:21 isaki Exp $  */
+/*     $NetBSD: chdsk.c,v 1.4 2011/04/11 14:00:02 tsutsui Exp $        */
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -36,6 +36,7 @@
 int
 changedisk_hook(struct open_file *f)
 {
+
        if (strcmp(f->f_dev->dv_name, "fd") == 0) {
                struct fd_softc *sc = f->f_devdata;
                int drive[2];
diff -r 14f6b5f7031d -r 195aacddf4c9 sys/arch/x68k/stand/libsa/consio.c
--- a/sys/arch/x68k/stand/libsa/consio.c        Mon Apr 11 13:49:41 2011 +0000
+++ b/sys/arch/x68k/stand/libsa/consio.c        Mon Apr 11 14:00:02 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: consio.c,v 1.6 2011/04/11 13:48:32 tsutsui Exp $       */
+/*     $NetBSD: consio.c,v 1.7 2011/04/11 14:00:02 tsutsui Exp $       */
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -42,12 +42,13 @@
 int
 consio_init(int device)
 {
+
        if (device < 0) {       /* undetemined yet */
                if (KEYCTRL & 8)
                        device = ITE;
                else {
-                       IOCS_B_PRINT ("No keyboard; "
-                                     "switching to serial console...");
+                       IOCS_B_PRINT("No keyboard; "
+                                    "switching to serial console...");
                        device = SERIAL;
                }
        }
@@ -56,12 +57,12 @@
        case ITE:
                x68k_console_device = ITE;
                /* set palette here */
-               IOCS_OS_CURON ();
+               IOCS_OS_CURON();
                break;
        case SERIAL:
                x68k_console_device = SERIAL;
-               IOCS_OS_CUROF ();
-               IOCS_SET232C (SERPARAM);
+               IOCS_OS_CUROF();
+               IOCS_SET232C(SERPARAM);
        }
 
        return x68k_console_device;
@@ -74,10 +75,10 @@
 
        switch (x68k_console_device) {
        case ITE:
-               while ((r = IOCS_B_KEYINP () & 0xff) == 0);
+               while ((r = IOCS_B_KEYINP() & 0xff) == 0);
                return r;
        case SERIAL:
-               while ((r = IOCS_INP232C () & 0xff) == 0);
+               while ((r = IOCS_INP232C() & 0xff) == 0);
                return r;
        }
 
@@ -87,14 +88,15 @@
 void
 putchar(int c)
 {
+
        if (c == '\n')
                putchar('\r');
        switch (x68k_console_device) {
        case ITE:
-               IOCS_B_PUTC (c);
+               IOCS_B_PUTC(c);
                break;
        case SERIAL:
-               IOCS_OUT232C (c);
+               IOCS_OUT232C(c);
                break;
        }
 }
@@ -102,11 +104,12 @@
 int
 check_getchar(void)
 {
+
        switch (x68k_console_device) {
        case ITE:
-               return IOCS_B_KEYSNS () & 0xff;
+               return IOCS_B_KEYSNS() & 0xff;
        case SERIAL:
-               return IOCS_ISNS232C () & 0xff;
+               return IOCS_ISNS232C() & 0xff;
        }
 
        return -1;
diff -r 14f6b5f7031d -r 195aacddf4c9 sys/arch/x68k/stand/libsa/consio.h
--- a/sys/arch/x68k/stand/libsa/consio.h        Mon Apr 11 13:49:41 2011 +0000
+++ b/sys/arch/x68k/stand/libsa/consio.h        Mon Apr 11 14:00:02 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: consio.h,v 1.2 2011/04/11 13:47:16 tsutsui Exp $       */
+/*     $NetBSD: consio.h,v 1.3 2011/04/11 14:00:02 tsutsui Exp $       */
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -26,13 +26,13 @@
  */
 
 #define KEYCTRL_PHYS   (0x00e8e000+7)
-#define KEYCTRL                (*((volatile unsigned char *)KEYCTRL_PHYS))
+#define KEYCTRL                (*((volatile uint8_t *)KEYCTRL_PHYS))
 
 #define MFP_TIMERC_PHYS        (0x00e88000+0x23)
-#define MFP_TIMERC     (*((volatile unsigned char *)MFP_TIMERC_PHYS))
+#define MFP_TIMERC     (*((volatile uint8_t *)MFP_TIMERC_PHYS))
 #define JOYA_PHYS      (0x00e9a000+1)
-#define JOYA           (*((volatile unsigned char *)JOYA_PHYS))
+#define JOYA           (*((volatile uint8_t *)JOYA_PHYS))
 
 #define SRAM_PHYS      0x00ed0000
 #define SERPARAM_PHYS  (SRAM_PHYS + 26)
-#define SERPARAM       (*((unsigned short *)SERPARAM_PHYS))
+#define SERPARAM       (*((uint16_t *)SERPARAM_PHYS))
diff -r 14f6b5f7031d -r 195aacddf4c9 sys/arch/x68k/stand/libsa/devopen.c
--- a/sys/arch/x68k/stand/libsa/devopen.c       Mon Apr 11 13:49:41 2011 +0000
+++ b/sys/arch/x68k/stand/libsa/devopen.c       Mon Apr 11 14:00:02 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: devopen.c,v 1.4 2007/11/11 05:20:27 isaki Exp $        */
+/*     $NetBSD: devopen.c,v 1.5 2011/04/11 14:00:02 tsutsui Exp $      */
 
 /*
  * Copyright (c) 2001 Minoura Makoto
@@ -91,17 +91,17 @@
 
        error = devparse(fname, &dev, &unit, &part, file);
        if (error)
-           return error;
+               return error;
 
        dp = &devsw[dev];
 
-       if (!dp->dv_open)
+       if (dp->dv_open == NULL)
                return ENODEV;
 
        f->f_dev = dp;
 
        if ((error = (*dp->dv_open)(f, unit, part)) == 0)
-           return 0;
+               return 0;
 
        return error;
 }
diff -r 14f6b5f7031d -r 195aacddf4c9 sys/arch/x68k/stand/libsa/fd.c
--- a/sys/arch/x68k/stand/libsa/fd.c    Mon Apr 11 13:49:41 2011 +0000
+++ b/sys/arch/x68k/stand/libsa/fd.c    Mon Apr 11 14:00:02 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fd.c,v 1.5 2007/11/18 05:00:08 isaki Exp $     */
+/*     $NetBSD: fd.c,v 1.6 2011/04/11 14:00:02 tsutsui Exp $   */
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -112,7 +112,7 @@
        head = (dblk / nsect) % nhead + sc->fmt.minsec.H;
        cyl = (dblk / nsect) / nhead + sc->fmt.minsec.C;
 
-       error = IOCS_B_READ((sc->unit+0x90)*256 + 0x70,
+       error = IOCS_B_READ((sc->unit + 0x90) * 256 + 0x70,
                            ((sc->fmt.minsec.N << 24) |
                             (cyl << 16) |
                             (head << 8) |
diff -r 14f6b5f7031d -r 195aacddf4c9 sys/arch/x68k/stand/libsa/sdcd.c
--- a/sys/arch/x68k/stand/libsa/sdcd.c  Mon Apr 11 13:49:41 2011 +0000
+++ b/sys/arch/x68k/stand/libsa/sdcd.c  Mon Apr 11 14:00:02 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdcd.c,v 1.8 2007/11/18 05:00:08 isaki Exp $   */
+/*     $NetBSD: sdcd.c,v 1.9 2011/04/11 14:00:02 tsutsui Exp $ */
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -126,8 +126,8 @@
        if (error)
                return error;
        if (current_blklen > 4) {
-               printf ("FATAL: Unsupported block size %d.\n",
-                       256 << current_blklen);
+               printf("FATAL: Unsupported block size %d.\n",
+                   256 << current_blklen);
                return ERDLAB;
        }
 
@@ -268,6 +268,7 @@
 int
 sdclose(struct open_file *f)
 {
+
        dealloc(f->f_devdata, sizeof(struct sdcd_softc));
        return 0;
 }
@@ -277,7 +278,7 @@
            void *buf, size_t *rsize)
 {
        struct sdcd_softc *sc = arg;
-       u_int32_t       start = sc->sc_partinfo.start + dblk;
+       uint32_t        start = sc->sc_partinfo.start + dblk;
        size_t          nblks;
        int             error;
 
@@ -347,6 +348,7 @@
 int
 cdclose(struct open_file *f)
 {
+
        dealloc(f->f_devdata, sizeof(struct sdcd_softc));
        return 0;
 }
diff -r 14f6b5f7031d -r 195aacddf4c9 sys/arch/x68k/stand/libsa/sdcdvar.h
--- a/sys/arch/x68k/stand/libsa/sdcdvar.h       Mon Apr 11 13:49:41 2011 +0000
+++ b/sys/arch/x68k/stand/libsa/sdcdvar.h       Mon Apr 11 14:00:02 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdcdvar.h,v 1.1 2001/09/27 10:03:28 minoura Exp $      */
+/*     $NetBSD: sdcdvar.h,v 1.2 2011/04/11 14:00:02 tsutsui Exp $      */
 
 /*
  * Copyright (c) 2001 Minoura Makoto
@@ -30,6 +30,6 @@
 #define BLKBYTES(len)  (1 << ((len) + 8))
 
 struct boot_partinfo {
-       u_int32_t       start;  /* in blocks */
-       u_int32_t       size;   /* in blocks */
+       uint32_t        start;  /* in blocks */
+       uint32_t        size;   /* in blocks */
 };



Home | Main Index | Thread Index | Old Index