Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sun3/dev - constify



details:   https://anonhg.NetBSD.org/src/rev/30c7a75d97d7
branches:  trunk
changeset: 581661:30c7a75d97d7
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Jun 03 15:07:12 2005 +0000

description:
- constify
- fix shadowing variables

diffstat:

 sys/arch/sun3/dev/xd.c |  31 ++++++++++++++++---------------
 1 files changed, 16 insertions(+), 15 deletions(-)

diffs (86 lines):

diff -r 08976487a7ed -r 30c7a75d97d7 sys/arch/sun3/dev/xd.c
--- a/sys/arch/sun3/dev/xd.c    Fri Jun 03 15:06:40 2005 +0000
+++ b/sys/arch/sun3/dev/xd.c    Fri Jun 03 15:07:12 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xd.c,v 1.48 2005/01/22 15:36:10 chs Exp $      */
+/*     $NetBSD: xd.c,v 1.49 2005/06/03 15:07:12 tsutsui Exp $  */
 
 /*
  *
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.48 2005/01/22 15:36:10 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.49 2005/06/03 15:07:12 tsutsui Exp $");
 
 #undef XDC_DEBUG               /* full debug */
 #define XDC_DIAG               /* extra sanity checks */
@@ -221,7 +221,7 @@
 
 /* internals */
 int    xdc_cmd(struct xdc_softc *, int, int, int, int, int, char *, int);
-char   *xdc_e2str(int);
+const char *xdc_e2str(int);
 int    xdc_error(struct xdc_softc *, struct xd_iorq *, struct xd_iopb *, int,
            int);
 int    xdc_ioctlcmd(struct xd_softc *, dev_t dev, struct xd_iocmd *);
@@ -1986,27 +1986,28 @@
        struct xdc_softc *xdcsc = arg;
        int     lcv, s, reset = 0;
 #ifdef XDC_DIAG
-       int     wait, run, free, done, whd = 0;
+       int     nwait, nrun, nfree, ndone, whd = 0;
        u_char  fqc[XDC_MAXIOPB], wqc[XDC_MAXIOPB], mark[XDC_MAXIOPB];
        s = splbio();
-       wait = xdcsc->nwait;
-       run = xdcsc->nrun;
-       free = xdcsc->nfree;
-       done = xdcsc->ndone;
+       nwait = xdcsc->nwait;
+       nrun = xdcsc->nrun;
+       nfree = xdcsc->nfree;
+       ndone = xdcsc->ndone;
        memcpy(wqc, xdcsc->waitq, sizeof(wqc));
        memcpy(fqc, xdcsc->freereq, sizeof(fqc));
        splx(s);
-       if (wait + run + free + done != XDC_MAXIOPB) {
+       if (nwait + nrun + nfree + ndone != XDC_MAXIOPB) {
                printf("%s: diag: IOPB miscount (got w/f/r/d %d/%d/%d/%d, wanted %d)\n",
-                   xdcsc->sc_dev.dv_xname, wait, free, run, done, XDC_MAXIOPB);
+                   xdcsc->sc_dev.dv_xname, nwait, nfree, nrun, ndone,
+                   XDC_MAXIOPB);
                memset(mark, 0, sizeof(mark));
                printf("FREE: ");
-               for (lcv = free; lcv > 0; lcv--) {
+               for (lcv = nfree; lcv > 0; lcv--) {
                        printf("%d ", fqc[lcv - 1]);
                        mark[fqc[lcv - 1]] = 1;
                }
                printf("\nWAIT: ");
-               lcv = wait;
+               lcv = nwait;
                while (lcv > 0) {
                        printf("%d ", wqc[whd]);
                        mark[wqc[whd]] = 1;
@@ -2025,9 +2026,9 @@
                                xdcsc->reqs[lcv].buf);
                }
        } else
-               if (done > XDC_MAXIOPB - XDC_SUBWAITLIM)
+               if (ndone > XDC_MAXIOPB - XDC_SUBWAITLIM)
                        printf("%s: diag: lots of done jobs (%d)\n",
-                               xdcsc->sc_dev.dv_xname, done);
+                               xdcsc->sc_dev.dv_xname, ndone);
 
 #endif
 #ifdef XDC_DEBUG
@@ -2197,7 +2198,7 @@
 /*
  * xdc_e2str: convert error code number into an error string
  */
-char *
+const char *
 xdc_e2str(int no)
 {
        switch (no) {



Home | Main Index | Thread Index | Old Index