Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/luna68k/stand/boot Misc KNF and cosmetics.



details:   https://anonhg.NetBSD.org/src/rev/1fb24c9e62d2
branches:  trunk
changeset: 792650:1fb24c9e62d2
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Jan 11 15:51:02 2014 +0000

description:
Misc KNF and cosmetics.

diffstat:

 sys/arch/luna68k/stand/boot/bmc.c             |  14 +++--
 sys/arch/luna68k/stand/boot/bmd.c             |  24 ++++----
 sys/arch/luna68k/stand/boot/cons.c            |   6 +-
 sys/arch/luna68k/stand/boot/disklabel.c       |  66 +++++++++++++++-----------
 sys/arch/luna68k/stand/boot/getline.c         |   4 +-
 sys/arch/luna68k/stand/boot/if_le.c           |  12 ++--
 sys/arch/luna68k/stand/boot/init_main.c       |  18 ++++---
 sys/arch/luna68k/stand/boot/kbd.c             |  12 ++--
 sys/arch/luna68k/stand/boot/kbdreg.h          |   8 +-
 sys/arch/luna68k/stand/boot/lance.c           |   6 +-
 sys/arch/luna68k/stand/boot/locore.S          |  28 +++++-----
 sys/arch/luna68k/stand/boot/machdep.c         |  47 +++++++++++--------
 sys/arch/luna68k/stand/boot/omron_disklabel.h |  40 ++++++++--------
 sys/arch/luna68k/stand/boot/parse.c           |  23 ++++----
 sys/arch/luna68k/stand/boot/preset.h          |  24 +++++----
 sys/arch/luna68k/stand/boot/rcvbuf.h          |  17 ++++--
 sys/arch/luna68k/stand/boot/romcons.c         |   6 +-
 sys/arch/luna68k/stand/boot/sc.c              |  53 ++++++++++++---------
 sys/arch/luna68k/stand/boot/screen.c          |   4 +-
 sys/arch/luna68k/stand/boot/scsi.c            |  47 +++++++++---------
 sys/arch/luna68k/stand/boot/sd.c              |  13 ++--
 sys/arch/luna68k/stand/boot/sioreg.h          |  10 ++--
 sys/arch/luna68k/stand/boot/ufs_disksubr.c    |   7 +-
 23 files changed, 266 insertions(+), 223 deletions(-)

diffs (truncated from 1366 to 300 lines):

diff -r f90e18e173ab -r 1fb24c9e62d2 sys/arch/luna68k/stand/boot/bmc.c
--- a/sys/arch/luna68k/stand/boot/bmc.c Sat Jan 11 14:35:15 2014 +0000
+++ b/sys/arch/luna68k/stand/boot/bmc.c Sat Jan 11 15:51:02 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bmc.c,v 1.4 2013/01/21 11:58:12 tsutsui Exp $  */
+/*     $NetBSD: bmc.c,v 1.5 2014/01/11 15:51:02 tsutsui Exp $  */
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -88,6 +88,7 @@
 void
 bmccnprobe(struct consdev *cp)
 {
+
        if ((dipsw1 & PS_BMC_CONS) == 0) {
                cp->cn_pri = CN_DEAD;
                return;
@@ -106,6 +107,7 @@
 void
 bmccninit(struct consdev *cp)
 {
+
        sioinit();
        bmdinit();
 }
@@ -121,14 +123,16 @@
 
        POP_RBUF(unit, c);
 
-       return(c);
-/*
-       return(siocngetc(dev));
- */
+#if 1
+       return c ;
+#else
+       return siocngetc(dev);
+#endif
 }
 
 void
 bmccnputc(dev_t dev, int c)
 {
+
        bmdputc(c);
 }
diff -r f90e18e173ab -r 1fb24c9e62d2 sys/arch/luna68k/stand/boot/bmd.c
--- a/sys/arch/luna68k/stand/boot/bmd.c Sat Jan 11 14:35:15 2014 +0000
+++ b/sys/arch/luna68k/stand/boot/bmd.c Sat Jan 11 15:51:02 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bmd.c,v 1.3 2014/01/02 20:02:00 tsutsui Exp $  */
+/*     $NetBSD: bmd.c,v 1.4 2014/01/11 15:51:02 tsutsui Exp $  */
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -113,8 +113,8 @@
 #define FB_HEIGHT      20                      /* Font Hight    (Bit) */
 
 
-#define NEXT_LINE(addr)                        ( addr +  (PL_WIDTH * FB_HEIGHT) )
-#define SKIP_NEXT_LINE(addr)           ( addr += (PL_WIDTH - SL_WIDTH) )
+#define NEXT_LINE(addr)                        (addr +  (PL_WIDTH * FB_HEIGHT))
+#define SKIP_NEXT_LINE(addr)           (addr += (PL_WIDTH - SL_WIDTH))
 
 
 void   bmd_draw_char(char *, char *, int, int, int);
@@ -279,7 +279,7 @@
 void
 bmdinit(void)
 {
-       volatile uint32_t *bmd_rfcnt = (uint32_t *) 0xB1000000;
+       volatile uint32_t *bmd_rfcnt = (uint32_t *)0xB1000000;
        volatile long *bmd_bmsel = (long *)0xB1040000;
        struct bmd_softc *bp = &bmd_softc;
        struct bmd_linec *bq;
@@ -290,8 +290,8 @@
         *  adjust plane position
         */
 
-       bp->bc_raddr = (char *) 0xB10C0008;     /* plane-0 hardware address */
-       bp->bc_waddr = (char *) 0xB1080008; /* common bitmap hardware address */
+       bp->bc_raddr = (char *)0xB10C0008;      /* plane-0 hardware address */
+       bp->bc_waddr = (char *)0xB1080008; /* common bitmap hardware address */
        rfcnt.p.rfc_hcnt = 7;                   /* shift left   16 dot */
        rfcnt.p.rfc_vcnt = -27;                 /* shift down    1 dot */
        *bmd_rfcnt = rfcnt.u;
@@ -306,11 +306,11 @@
        bp->bc_row = bp->bc_ymin;
 
        for (i = bp->bc_ymin; i < bp->bc_ymax; i++) {
-               bmd_linec[i].bl_next = &bmd_linec[i+1];
-               bmd_linec[i].bl_prev = &bmd_linec[i-1];
+               bmd_linec[i].bl_next = &bmd_linec[i + 1];
+               bmd_linec[i].bl_prev = &bmd_linec[i - 1];
        }
-       bmd_linec[bp->bc_ymax-1].bl_next = &bmd_linec[bp->bc_ymin];
-       bmd_linec[bp->bc_ymin].bl_prev = &bmd_linec[bp->bc_ymax-1];
+       bmd_linec[bp->bc_ymax - 1].bl_next = &bmd_linec[bp->bc_ymin];
+       bmd_linec[bp->bc_ymin].bl_prev = &bmd_linec[bp->bc_ymax - 1];
 
        bq = bp->bc_bl = &bmd_linec[bp->bc_ymin];
        bq->bl_col = bq->bl_end = bp->bc_xmin;
@@ -333,7 +333,7 @@
 void
 bmdadjust(short hcnt, short vcnt)
 {
-       volatile uint32_t *bmd_rfcnt = (uint32_t *) 0xB1000000;
+       volatile uint32_t *bmd_rfcnt = (uint32_t *)0xB1000000;
        union bmd_rfcnt rfcnt;
 
        printf("bmdadjust: hcnt = %d, vcnt = %d\n", hcnt, vcnt);
@@ -437,7 +437,7 @@
                         bp->bc_waddr,
                         bq->bl_col, bp->bc_row);
 
-       return(c);
+       return c;
 }
 
 void
diff -r f90e18e173ab -r 1fb24c9e62d2 sys/arch/luna68k/stand/boot/cons.c
--- a/sys/arch/luna68k/stand/boot/cons.c        Sat Jan 11 14:35:15 2014 +0000
+++ b/sys/arch/luna68k/stand/boot/cons.c        Sat Jan 11 15:51:02 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cons.c,v 1.1 2013/01/05 17:44:24 tsutsui Exp $ */
+/*     $NetBSD: cons.c,v 1.2 2014/01/11 15:51:02 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -127,8 +127,8 @@
 cngetc(void)
 {
        if (cn_tab == NULL)
-               return(0);
-       return((*cn_tab->cn_getc)(cn_tab->cn_dev));
+               return 0;
+       return (*cn_tab->cn_getc)(cn_tab->cn_dev);
 }
 
 void
diff -r f90e18e173ab -r 1fb24c9e62d2 sys/arch/luna68k/stand/boot/disklabel.c
--- a/sys/arch/luna68k/stand/boot/disklabel.c   Sat Jan 11 14:35:15 2014 +0000
+++ b/sys/arch/luna68k/stand/boot/disklabel.c   Sat Jan 11 15:51:02 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disklabel.c,v 1.3 2013/01/22 15:48:40 tsutsui Exp $    */
+/*     $NetBSD: disklabel.c,v 1.4 2014/01/11 15:51:02 tsutsui Exp $    */
 
 /*
  * Copyright (c) 1992 OMRON Corporation.
@@ -104,7 +104,7 @@
        end = (u_short *)&lp->d_partitions[lp->d_npartitions];
        while (start < end)
                sum ^= *start++;
-       return (sum);
+       return sum;
 }
 #endif
 
@@ -121,7 +121,7 @@
 
        if (argc < 2) {
                printf("This command is required sub command !!\n");
-               return(ST_ERROR);
+               return ST_ERROR;
        }
 
        if (!strcmp(argv[1], "help")) {
@@ -131,7 +131,8 @@
                printf("\twrite:\t\twrite disklabel to scsi_device\n");
                printf("\tomron:\t\tshow OMRON disklabel infomation\n");
                printf("\tbsd:\t\tshow BSD disklabel infomation\n");
-               printf("\tcopy:\t\tcopy disklabel infomation from OMRON to BSD\n");
+               printf("\tcopy:\t\tcopy disklabel infomation from OMRON"
+                   " to BSD\n");
                printf("\tchecksum:\tdoing checksum\n");
                printf("\tset:\t\tchange BSD disklabel infomation\n");
                printf("\n\n");
@@ -146,29 +147,37 @@
                i -= (int) lbl_buff;
                printf("Offset = %d\n", i);
                printf("\n");
-               printf("Checksum of Bad Track:\t0x%x\n",        omp->dkl_badchk);
-               printf("Logical Block Total:\t%u(0x%x)\n",      omp->dkl_maxblk, omp->dkl_maxblk);
-               printf("Disk Drive Type:\t0x%x\n",              omp->dkl_dtype);
-               printf("Number of Disk Drives:\t%d(0x%x)\n",    omp->dkl_ndisk, omp->dkl_ndisk);
-               printf("Number of Data Cylinders:\t%d(0x%x)\n", omp->dkl_ncyl, omp->dkl_ncyl);
+               printf("Checksum of Bad Track:\t0x%x\n",
+                   omp->dkl_badchk);
+               printf("Logical Block Total:\t%u(0x%x)\n",
+                   omp->dkl_maxblk, omp->dkl_maxblk);
+               printf("Disk Drive Type:\t0x%x\n",
+                   omp->dkl_dtype);
+               printf("Number of Disk Drives:\t%d(0x%x)\n",
+                   omp->dkl_ndisk, omp->dkl_ndisk);
+               printf("Number of Data Cylinders:\t%d(0x%x)\n",
+                   omp->dkl_ncyl, omp->dkl_ncyl);
                printf("Number of Alternate Cylinders:\t%d(0x%x)\n",
-                      omp->dkl_acyl,omp->dkl_acyl);
+                   omp->dkl_acyl,omp->dkl_acyl);
                printf("Number of Heads in This Partition:\t%d(0x%x)\n",
-                      omp->dkl_nhead, omp->dkl_nhead);
+                   omp->dkl_nhead, omp->dkl_nhead);
                printf("Number of 512 byte Sectors per Track:\t%d(0x%x)\n",
-                      omp->dkl_nsect, omp->dkl_nsect);
+                   omp->dkl_nsect, omp->dkl_nsect);
                printf("Identifies Proper Label Locations:\t0x%x\n",
-                      omp->dkl_bhead);
+                   omp->dkl_bhead);
                printf("Physical Partition Number:\t%d(0x%x)\n",
-                      omp->dkl_ppart, omp->dkl_ppart);
+                   omp->dkl_ppart, omp->dkl_ppart);
                for (i = 0; i < NLPART; i++)
                        printf("\t%d:\t%d\t%d\n", i,
-                              omp->dkl_map[i].dkl_blkno, omp->dkl_map[i].dkl_nblk);
-               printf("Identifies This Label Format:\t0x%x\n", omp->dkl_magic);
-               printf("XOR Checksum of Sector:\t0x%x\n",       omp->dkl_cksum);
+                           omp->dkl_map[i].dkl_blkno,
+                           omp->dkl_map[i].dkl_nblk);
+               printf("Identifies This Label Format:\t0x%x\n",
+                   omp->dkl_magic);
+               printf("XOR Checksum of Sector:\t0x%x\n",
+                   omp->dkl_cksum);
        } else if (!strcmp(argv[1], "checksum")) {
                if (omp->dkl_magic == DKL_MAGIC){
-                                                       /* checksum of disk-label */
+                       /* checksum of disk-label */
                        chksum = 0;
                        count = sizeof(struct scd_dk_label) / sizeof(short int);
                        for (p= (u_short *) lbl_buff; count > 0; count--) {
@@ -209,8 +218,10 @@
                bp->d_sbsize     = SBSIZE;
 
                for (i = 0; i < MAXPARTITIONS; i++) {
-                       bp->d_partitions[i].p_size   = omp->dkl_map[i].dkl_nblk;
-                       bp->d_partitions[i].p_offset = omp->dkl_map[i].dkl_blkno;
+                       bp->d_partitions[i].p_size   =
+                           omp->dkl_map[i].dkl_nblk;
+                       bp->d_partitions[i].p_offset =
+                           omp->dkl_map[i].dkl_blkno;
                        bp->d_partitions[i].p_fsize  = 1024;
                        bp->d_partitions[i].p_frag   = 8192 / 1024;
                        bp->d_partitions[i].p_fstype = FS_UNUSED;
@@ -254,7 +265,8 @@
                }
                switch (*argv[2]) {
                case 'b':
-                       bp->d_partitions[i].p_frag = j / bp->d_partitions[i].p_fsize;
+                       bp->d_partitions[i].p_frag =
+                           j / bp->d_partitions[i].p_fsize;
                        break;
                case 'f':       /* fragment size */
                        bp->d_partitions[i].p_fsize = j;
@@ -281,7 +293,7 @@
                /* restump checksum of OMRON disklabel */
                chksum = 0;
                count = sizeof(struct scd_dk_label) / sizeof(short int);
-               for (p= (u_short *) lbl_buff; count > 1; count--) {
+               for (p = (u_short *)lbl_buff; count > 1; count--) {
                        chksum ^= *p++;
                }
                omp->dkl_cksum = chksum;
@@ -289,10 +301,10 @@
        } else if (!strcmp(argv[1], "sb")) {
 #define BLOCK_SIZE     SBSIZE
 
-               printf("checking Super Block: block size = %d bytes, seek amount = 1 blocks\n",
-                       BLOCK_SIZE);
+               printf("checking Super Block: block size = %d bytes,"
+                   " seek amount = 1 blocks\n", BLOCK_SIZE);
                i = j = 0;
-               while(1) {
+               while (1) {
                        if (!scsi_read( i, lbl_buff, BLOCK_SIZE))
                        break;
 
@@ -305,7 +317,7 @@
        } else if (!strcmp(argv[1], "sbcopy")) {
                if (!scsi_read(32, lbl_buff, BLOCK_SIZE)) {
                        printf("sbcopy: read failed\n");
-                       return(ST_ERROR);
+                       return ST_ERROR;
                }
                if (scsi_write(16, lbl_buff, BLOCK_SIZE)) {
                        printf("sbcopy: copy done\n");
@@ -314,7 +326,7 @@
                }
        }
 
-       return(ST_NORMAL);
+       return ST_NORMAL;
 }
 
 void
diff -r f90e18e173ab -r 1fb24c9e62d2 sys/arch/luna68k/stand/boot/getline.c
--- a/sys/arch/luna68k/stand/boot/getline.c     Sat Jan 11 14:35:15 2014 +0000
+++ b/sys/arch/luna68k/stand/boot/getline.c     Sat Jan 11 15:51:02 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getline.c,v 1.3 2014/01/03 06:37:13 tsutsui Exp $      */
+/*     $NetBSD: getline.c,v 1.4 2014/01/11 15:51:02 tsutsui Exp $      */
 



Home | Main Index | Thread Index | Old Index