Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sh5/dev Fix const and shadow variable fallout.



details:   https://anonhg.NetBSD.org/src/rev/e8642d155318
branches:  trunk
changeset: 581387:e8642d155318
user:      scw <scw%NetBSD.org@localhost>
date:      Wed Jun 01 10:55:07 2005 +0000

description:
Fix const and shadow variable fallout.

diffstat:

 sys/arch/sh5/dev/cprc.c   |   8 +++++---
 sys/arch/sh5/dev/cpu_sh.c |  12 ++++++------
 sys/arch/sh5/dev/rtc.c    |  24 ++++++++++++------------
 sys/arch/sh5/dev/scif.c   |  22 +++++++++++-----------
 4 files changed, 34 insertions(+), 32 deletions(-)

diffs (224 lines):

diff -r 05be8243498f -r e8642d155318 sys/arch/sh5/dev/cprc.c
--- a/sys/arch/sh5/dev/cprc.c   Wed Jun 01 10:00:35 2005 +0000
+++ b/sys/arch/sh5/dev/cprc.c   Wed Jun 01 10:55:07 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cprc.c,v 1.7 2003/07/15 03:35:58 lukem Exp $   */
+/*     $NetBSD: cprc.c,v 1.8 2005/06/01 10:55:07 scw Exp $     */
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cprc.c,v 1.7 2003/07/15 03:35:58 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cprc.c,v 1.8 2005/06/01 10:55:07 scw Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -128,7 +128,9 @@
        printf(": Clock, Power and Watchdog/Reset Controller\n");
 
        for (i = 0; cprc_subdevs[i] != NULL; i++) {
-               child = config_found(self, (void *)cprc_subdevs[i], cprcprint);
+               char name[16];
+               strlcpy(name, cprc_subdevs[i], sizeof(name));
+               child = config_found(self, name, cprcprint);
                if (i == 0 && child == NULL)
                        panic("%s: no clock driver configured!",self->dv_xname);
        }
diff -r 05be8243498f -r e8642d155318 sys/arch/sh5/dev/cpu_sh.c
--- a/sys/arch/sh5/dev/cpu_sh.c Wed Jun 01 10:00:35 2005 +0000
+++ b/sys/arch/sh5/dev/cpu_sh.c Wed Jun 01 10:55:07 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu_sh.c,v 1.7 2003/11/09 21:12:08 scw Exp $   */
+/*     $NetBSD: cpu_sh.c,v 1.8 2005/06/01 10:55:07 scw Exp $   */
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_sh.c,v 1.7 2003/11/09 21:12:08 scw Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_sh.c,v 1.8 2005/06/01 10:55:07 scw Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -91,7 +91,7 @@
        struct superhyway_attach_args *sa = args;
        bus_space_handle_t bh;
        u_int64_t vcr;
-       u_int cpuid, version;
+       u_int cpuid, vers;
        const char *cpustr;
        char str[64];
 
@@ -106,10 +106,10 @@
         */
        if (vcr == 0) {
                cpuid = bootparams.bp_cpu[0].cpuid;
-               version = bootparams.bp_cpu[0].version;
+               vers = bootparams.bp_cpu[0].version;
        } else {
                cpuid = SUPERHYWAY_VCR_MOD_ID(vcr);
-               version = SUPERHYWAY_VCR_MOD_VERS(vcr);
+               vers = SUPERHYWAY_VCR_MOD_VERS(vcr);
        }
 
        switch (cpuid) {
@@ -124,7 +124,7 @@
        }
 
        printf("\n%s: %s, Version %d, %ld.%02ld MHz\n", self->dv_xname, cpustr,
-           version, (long)(bootparams.bp_cpu[0].speed / 1000000),
+           vers, (long)(bootparams.bp_cpu[0].speed / 1000000),
            (long)(bootparams.bp_cpu[0].speed % 1000000) / 10000);
 
        if (sh5_cache_ops.iinfo.type == SH5_CACHE_INFO_TYPE_NONE) {
diff -r 05be8243498f -r e8642d155318 sys/arch/sh5/dev/rtc.c
--- a/sys/arch/sh5/dev/rtc.c    Wed Jun 01 10:00:35 2005 +0000
+++ b/sys/arch/sh5/dev/rtc.c    Wed Jun 01 10:55:07 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtc.c,v 1.8 2003/07/18 21:41:24 thorpej Exp $  */
+/*     $NetBSD: rtc.c,v 1.9 2005/06/01 10:55:07 scw Exp $      */
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtc.c,v 1.8 2003/07/18 21:41:24 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtc.c,v 1.9 2005/06/01 10:55:07 scw Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -120,7 +120,7 @@
        struct rtc_softc *sc = todr->cookie;
        struct clock_ymdhms dt;
        u_int8_t r64cnt;
-       u_int8_t sec, min, hour;
+       u_int8_t second, minute, hour;
        u_int8_t dow, day, mon;
        u_int16_t year;
        int s, retry;
@@ -131,8 +131,8 @@
        do {
                r64cnt = rtc_read_r64cnt(sc->sc_bust, sc->sc_bush);
 
-               sec = rtc_read(sc, RTC_REG_RSECCNT);
-               min = rtc_read(sc, RTC_REG_RMINCNT);
+               second = rtc_read(sc, RTC_REG_RSECCNT);
+               minute = rtc_read(sc, RTC_REG_RMINCNT);
                hour = rtc_read(sc, RTC_REG_RHRCNT);
                dow = rtc_read(sc, RTC_REG_RWKCNT);
                day = rtc_read(sc, RTC_REG_RDAYCNT);
@@ -151,8 +151,8 @@
                return (1);
        }
 
-       dt.dt_sec = FROMBCD(sec);
-       dt.dt_min = FROMBCD(min);
+       dt.dt_sec = FROMBCD(second);
+       dt.dt_min = FROMBCD(minute);
        dt.dt_hour = FROMBCD(hour);
        dt.dt_day = FROMBCD(day);
        dt.dt_wday = FROMBCD(dow);
@@ -172,15 +172,15 @@
        struct rtc_softc *sc = todr->cookie;
        struct clock_ymdhms dt;
        u_int8_t r64cnt;
-       u_int8_t sec, min, hour;
+       u_int8_t second, minute, hour;
        u_int8_t dow, day, mon;
        u_int16_t year;
        int s, retry;
 
        clock_secs_to_ymdhms(tv->tv_sec, &dt);
 
-       sec = TOBCD(dt.dt_sec);
-       min = TOBCD(dt.dt_min);
+       second = TOBCD(dt.dt_sec);
+       minute = TOBCD(dt.dt_min);
        hour = TOBCD(dt.dt_hour);
        day = TOBCD(dt.dt_day);
        dow = TOBCD(dt.dt_wday);
@@ -200,8 +200,8 @@
                rtc_write(sc, RTC_REG_RDAYCNT, day);
                rtc_write(sc, RTC_REG_RWKCNT, dow);
                rtc_write(sc, RTC_REG_RHRCNT, hour);
-               rtc_write(sc, RTC_REG_RMINCNT, min);
-               rtc_write(sc, RTC_REG_RSECCNT, sec);
+               rtc_write(sc, RTC_REG_RMINCNT, minute);
+               rtc_write(sc, RTC_REG_RSECCNT, second);
 
                retry--;
        } while (r64cnt != rtc_read_r64cnt(sc->sc_bust, sc->sc_bush) && retry);
diff -r 05be8243498f -r e8642d155318 sys/arch/sh5/dev/scif.c
--- a/sys/arch/sh5/dev/scif.c   Wed Jun 01 10:00:35 2005 +0000
+++ b/sys/arch/sh5/dev/scif.c   Wed Jun 01 10:55:07 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scif.c,v 1.14 2004/12/13 02:34:03 chs Exp $    */
+/*     $NetBSD: scif.c,v 1.15 2005/06/01 10:55:07 scw Exp $    */
 
 /*-
  * Copyright (C) 1999 T.Horiuchi and SAITOH Masanobu.  All rights reserved.
@@ -106,7 +106,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.14 2004/12/13 02:34:03 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scif.c,v 1.15 2005/06/01 10:55:07 scw Exp $");
 
 #include "opt_kgdb.h"
 
@@ -588,15 +588,15 @@
        /* Output the first chunk of the contiguous buffer. */
        {
                int n;
-               int max;
+               int maxb;
                int i;
 
                n = sc->sc_tbc;
-               max = sc->sc_fifolen -
+               maxb = sc->sc_fifolen -
                    ((scif_rd_scfdr2(sc) >> SCIF_SCFDR2_T_SHIFT) &
                        SCIF_SCFDR2_T_MASK);
-               if (n > max)
-                       n = max;
+               if (n > maxb)
+                       n = maxb;
 
                for (i = 0; i < n; i++) {
                        scif_putc(sc->sc_iot, sc->sc_ioh, *(sc->sc_tba));
@@ -1059,7 +1059,7 @@
 integrate void
 scif_rxsoft(struct scif_softc *sc, struct tty *tp)
 {
-       int (*rint)(int c, struct tty *tp) = tp->t_linesw->l_rint;
+       int (*rint)(int, struct tty *) = tp->t_linesw->l_rint;
        u_char *get, *end;
        u_int cc, scc;
        u_char ssr2;
@@ -1425,15 +1425,15 @@
                /* Output the next chunk of the contiguous buffer, if any. */
                if (sc->sc_tbc > 0) {
                        int n;
-                       int max;
+                       int maxb;
                        int i;
 
                        n = sc->sc_tbc;
-                       max = sc->sc_fifolen -
+                       maxb = sc->sc_fifolen -
                            ((scif_rd_scfdr2(sc) >> SCIF_SCFDR2_T_SHIFT) &
                                SCIF_SCFDR2_T_MASK);
-                       if (n > max)
-                               n = max;
+                       if (n > maxb)
+                               n = maxb;
 
                        for (i = 0; i < n; i++) {
                                scif_putc(sc->sc_iot, sc->sc_ioh,*(sc->sc_tba));



Home | Main Index | Thread Index | Old Index