Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/tc - fix an error in uninitialized variable reference.



details:   https://anonhg.NetBSD.org/src/rev/6c66ed27b371
branches:  trunk
changeset: 499546:6c66ed27b371
user:      nisimura <nisimura%NetBSD.org@localhost>
date:      Wed Nov 22 06:59:08 2000 +0000

description:
- fix an error in uninitialized variable reference.
- add a missing function argument declaration.
- minor comment adjustments.

diffstat:

 sys/dev/tc/zs_ioasic.c |  22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diffs (92 lines):

diff -r 2aa904019a86 -r 6c66ed27b371 sys/dev/tc/zs_ioasic.c
--- a/sys/dev/tc/zs_ioasic.c    Wed Nov 22 06:31:22 2000 +0000
+++ b/sys/dev/tc/zs_ioasic.c    Wed Nov 22 06:59:08 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs_ioasic.c,v 1.5 2000/10/17 09:27:22 nisimura Exp $ */
+/* $NetBSD: zs_ioasic.c,v 1.6 2000/11/22 06:59:08 nisimura Exp $ */
 
 /*-
  * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: zs_ioasic.c,v 1.5 2000/10/17 09:27:22 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs_ioasic.c,v 1.6 2000/11/22 06:59:08 nisimura Exp $");
 
 /*
  * Zilog Z8530 Dual UART driver (machine-dependent part).  This driver
@@ -222,7 +222,7 @@
        void *aux;
 {
        struct ioasicdev_attach_args *d = aux;
-       void *zs_addr;
+       tc_addr_t zs_addr;
 
        if (parent->dv_cfdata->cf_driver != &ioasic_cd)
                return (0);
@@ -245,7 +245,7 @@
        /*
         * Find out the device address, and check it for validity.
         */
-       zs_addr = (void *) TC_DENSE_TO_SPARSE((tc_addr_t) zs_addr);
+       zs_addr = TC_DENSE_TO_SPARSE((tc_addr_t)d->iada_addr);
        if (tc_badaddr(zs_addr))
                return (0);
 
@@ -659,7 +659,7 @@
 }
 
 /****************************************************************
- * Console support functions 
+ * Console support functions
  ****************************************************************/
 
 /*
@@ -740,8 +740,8 @@
 
 /*
  * zs_ioasic_cninit --
- *     Initialize the serial channel for console use--either the
- * primary keyboard or the serial console.
+ *     Initialize the serial channel for either a keyboard or
+ *     a serial console.
  */
 void
 zs_ioasic_cninit(ioasic_addr, zs_offset, channel)
@@ -780,6 +780,10 @@
        /* Setup temporary chanstate. */
        cs->cs_reg_csr = (void *)&zc->zc_csr;
 
+       cs->cs_channel = channel;
+       cs->cs_ops = &zsops_null;
+       cs->cs_brg_clk = PCLK / 16;
+
        /* Initialize the pending registers. */
        bcopy(zs_ioasic_init_reg, cs->cs_preg, 16);
        cs->cs_preg[5] |= (ZSWR5_DTR | ZSWR5_RTS);
@@ -813,6 +817,7 @@
 zs_ioasic_cnattach(ioasic_addr, zs_offset, channel)
        tc_addr_t ioasic_addr;
        tc_offset_t zs_offset;
+       int channel;
 {
        struct zs_chanstate *cs = &zs_ioasic_conschanstate_store;
 
@@ -828,7 +833,7 @@
 
 /*
  * zs_ioasic_lk201_cnattach --
- *     Initialize and attach the primary keyboard.
+ *     Initialize and attach a keyboard.
  */
 int
 zs_ioasic_lk201_cnattach(ioasic_addr, zs_offset, channel)
@@ -842,7 +847,6 @@
        zs_ioasic_cninit(ioasic_addr, zs_offset, channel);
        cs->cs_defspeed = 4800;
        cs->cs_defcflag = (TTYDEF_CFLAG & ~(CSIZE | PARENB)) | CS8;
-       cs->cs_brg_clk = PCLK / 16;
        return (zskbd_cnattach(cs));
 #else
        return (ENXIO);



Home | Main Index | Thread Index | Old Index