Source-Changes-HG archive

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

[src/trunk]: src/sys uninitialized variables.



details:   https://anonhg.NetBSD.org/src/rev/ec08c2eaf757
branches:  trunk
changeset: 554459:ec08c2eaf757
user:      chs <chs%NetBSD.org@localhost>
date:      Tue Oct 28 15:25:27 2003 +0000

description:
uninitialized variables.

diffstat:

 sys/arch/sparc/dev/com_obio.c  |  12 +++++++-----
 sys/arch/sparc/sparc/machdep.c |   5 +++--
 sys/arch/sparc/sparc/pmap.c    |  16 +++++++---------
 sys/dev/sbus/zx.c              |   6 +++---
 sys/dev/sun/pfour_subr.c       |  12 +++++++-----
 5 files changed, 27 insertions(+), 24 deletions(-)

diffs (198 lines):

diff -r 8cdca0691107 -r ec08c2eaf757 sys/arch/sparc/dev/com_obio.c
--- a/sys/arch/sparc/dev/com_obio.c     Tue Oct 28 14:49:53 2003 +0000
+++ b/sys/arch/sparc/dev/com_obio.c     Tue Oct 28 15:25:27 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: com_obio.c,v 1.16 2003/08/07 16:29:35 agc Exp $        */
+/*     $NetBSD: com_obio.c,v 1.17 2003/10/28 15:25:27 chs Exp $        */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com_obio.c,v 1.16 2003/08/07 16:29:35 agc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_obio.c,v 1.17 2003/10/28 15:25:27 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -121,13 +121,14 @@
        int tadpole = 0;
        int need_probe = 0;
        int rv = 0;
-       u_int8_t auxregval;
+       uint8_t auxregval = 0;
 
        if (uoba->uoba_isobio4 != 0) {
                return (0);
        }
 
-       /* Tadpole 3GX/3GS uses "modem" for a 16450 port
+       /*
+        * Tadpole 3GX/3GS uses "modem" for a 16450 port
         * (We need to enable it before probing)
         */
        if (strcmp("modem", sa->sa_name) == 0) {
@@ -138,7 +139,8 @@
                need_probe = 1;
        }
 
-       /* Sun JavaStation 1 uses "su" for a 16550 port
+       /*
+        * Sun JavaStation 1 uses "su" for a 16550 port
         */
        if (strcmp("su", sa->sa_name) == 0) {
                need_probe = 1;
diff -r 8cdca0691107 -r ec08c2eaf757 sys/arch/sparc/sparc/machdep.c
--- a/sys/arch/sparc/sparc/machdep.c    Tue Oct 28 14:49:53 2003 +0000
+++ b/sys/arch/sparc/sparc/machdep.c    Tue Oct 28 15:25:27 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.239 2003/10/21 20:59:31 kleink Exp $ */
+/*     $NetBSD: machdep.c,v 1.240 2003/10/28 15:25:27 chs Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.239 2003/10/21 20:59:31 kleink Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.240 2003/10/28 15:25:27 chs Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_sunos.h"
@@ -643,6 +643,7 @@
 
        default:
                /* Don't know what trampoline version; kill it. */
+               addr = 0;
                sigexit(l, SIGILL);
        }
 
diff -r 8cdca0691107 -r ec08c2eaf757 sys/arch/sparc/sparc/pmap.c
--- a/sys/arch/sparc/sparc/pmap.c       Tue Oct 28 14:49:53 2003 +0000
+++ b/sys/arch/sparc/sparc/pmap.c       Tue Oct 28 15:25:27 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.273 2003/10/02 16:02:09 hannken Exp $ */
+/*     $NetBSD: pmap.c,v 1.274 2003/10/28 15:25:27 chs Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.273 2003/10/02 16:02:09 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.274 2003/10/28 15:25:27 chs Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -3175,7 +3175,7 @@
        int npte, zseg, vr, vs;
        int startscookie, scookie;
 #if defined(SUN4_MMU3L)
-       int startrcookie, rcookie;
+       int startrcookie = 0, rcookie = 0;
 #endif
        int *kptes;
        int lastpage;
@@ -4705,8 +4705,7 @@
 
        for (; va < endva; va += NBPG, ptep++) {
                pte = *ptep;
-               if (inmmu)
-                       mmupte = getpte4(va);
+               mmupte = inmmu ? getpte4(va) : 0;
                if ((pte & PG_V) == 0) {
 #ifdef DIAGNOSTIC
                        if (inmmu && (mmupte & PG_V) != 0)
@@ -4851,6 +4850,7 @@
         */
        if (!inmmu) {
                perpage = 0;
+               pteva = 0;
        } else if (CTX_USABLE(pm,rp)) {
                /* process has a context, must flush cache */
                npg = (endva - va) >> PGSHIFT;
@@ -4878,8 +4878,7 @@
        for (; va < endva; ptep++, pteva += NBPG, va += NBPG) {
                int mmupte;
                pte = *ptep;
-               if (inmmu)
-                       mmupte = getpte4(pteva);
+               mmupte = inmmu ? getpte4(pteva) : 0;
 
                if ((pte & PG_V) == 0) {
 #ifdef DIAGNOSTIC
@@ -6112,8 +6111,7 @@
 
                for (; va < nva; va += NBPG, ptep++) {
                        pte = *ptep;
-                       if (inmmu)
-                               mmupte = getpte4(va);
+                       mmupte = inmmu ? getpte4(va) : 0;
                        if ((pte & PG_V) == 0) {
 #ifdef DIAGNOSTIC
                                if (inmmu && (mmupte & PG_V) != 0)
diff -r 8cdca0691107 -r ec08c2eaf757 sys/dev/sbus/zx.c
--- a/sys/dev/sbus/zx.c Tue Oct 28 14:49:53 2003 +0000
+++ b/sys/dev/sbus/zx.c Tue Oct 28 15:25:27 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zx.c,v 1.11 2003/10/28 14:18:39 ad Exp $       */
+/*     $NetBSD: zx.c,v 1.12 2003/10/28 15:25:27 chs Exp $      */
 
 /*
  *  Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zx.c,v 1.11 2003/10/28 14:18:39 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zx.c,v 1.12 2003/10/28 15:25:27 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -558,7 +558,7 @@
 zx_cross_loadwid(struct zx_softc *sc, u_int type, u_int index, u_int value)
 {
        volatile struct zx_cross *zx;
-       u_int tmp;
+       u_int tmp = 0;
 
        zx = sc->sc_zx;
        SETREG(zx->zx_type, ZX_CROSS_TYPE_WID);
diff -r 8cdca0691107 -r ec08c2eaf757 sys/dev/sun/pfour_subr.c
--- a/sys/dev/sun/pfour_subr.c  Tue Oct 28 14:49:53 2003 +0000
+++ b/sys/dev/sun/pfour_subr.c  Tue Oct 28 15:25:27 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pfour_subr.c,v 1.2 2001/11/13 06:54:32 lukem Exp $ */
+/*     $NetBSD: pfour_subr.c,v 1.3 2003/10/28 15:25:27 chs Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pfour_subr.c,v 1.2 2001/11/13 06:54:32 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pfour_subr.c,v 1.3 2003/10/28 15:25:27 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -118,11 +118,13 @@
                break;
 
        default:
+
                /*
-                * XXX: Do nothing, I guess.
-                * Should we print a warning about
-                * an unknown value? --thorpej
+                * Assume the smallest size.
                 */
+
+               width = 640;
+               height = 480;
                break;
        }
 



Home | Main Index | Thread Index | Old Index