summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-10-24 23:24:30 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-10-24 23:24:30 +0000
commit6374af0a5eb41086519cbb6370ae86d2032edc62 (patch)
tree089a02ad1c290404e7beb7181e42c113d4be8970 /sys/arch/i386
parentb52e39a2ac67cf4bada7e33eccd0a955a15db41c (diff)
uninitialized variables are bad
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/bios.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/sys/arch/i386/i386/bios.c b/sys/arch/i386/i386/bios.c
index 3c34b68720a..2dd03683aee 100644
--- a/sys/arch/i386/i386/bios.c
+++ b/sys/arch/i386/i386/bios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bios.c,v 1.13 1997/10/24 22:15:05 mickey Exp $ */
+/* $OpenBSD: bios.c,v 1.14 1997/10/24 23:24:29 deraadt Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff
@@ -117,7 +117,7 @@ biosattach(parent, self, aux)
struct bios_softc *sc = (void *) self;
struct bios_attach_args *bia = aux;
#if NAPM > 0 || defined(DEBUG)
- bios_apminfo_t *apm;
+ bios_apminfo_t *apm = NULL;
#endif
u_int8_t *va = ISA_HOLE_VADDR(0xffff0);
char *str;
@@ -135,7 +135,7 @@ biosattach(parent, self, aux)
case 0xf8: str = "PS/2 386+"; break;
}
printf(": %s(%02x) BIOS, date %c%c/%c%c/%c%c\n",
- str, va[15], va[5], va[6], va[8], va[9], va[11], va[12]);
+ str, va[15], va[5], va[6], va[8], va[9], va[11], va[12]);
printf("%s:", sc->sc_dev.dv_xname);
@@ -151,7 +151,9 @@ biosattach(parent, self, aux)
break;
case BOOTARG_APMINFO:
printf(" apminfo");
+#if NAPM > 0 || defined(DEBUG)
apm = (bios_apminfo_t *)q->ba_arg;
+#endif
break;
case BOOTARG_CKSUMLEN:
printf(" cksumlen");
@@ -163,13 +165,13 @@ biosattach(parent, self, aux)
printf("\n");
#if NAPM > 0
- {
+ if (apm) {
struct bios_attach_args ba;
#ifdef DEBUG
- printf("apminfo: %x, code %x/%x[%x], data %x[%x], entry %x\n",
- apm->apm_detail, apm->apm_code32_base,
- apm->apm_code16_base, apm->apm_code_len,
- apm->apm_data_base, apm->apm_data_len, apm->apm_entry);
+ printf("apminfo: %x, code %x/%x[%x], data %x[%x], entry %x\n",
+ apm->apm_detail, apm->apm_code32_base,
+ apm->apm_code16_base, apm->apm_code_len,
+ apm->apm_data_base, apm->apm_data_len, apm->apm_entry);
#endif
ba.bios_dev = "apm";
ba.bios_func = 0x15;
@@ -190,7 +192,7 @@ bios_print(aux, pnp)
if (pnp)
printf("%s at %s function 0x%x",
- ba->bios_dev, pnp, ba->bios_func);
+ ba->bios_dev, pnp, ba->bios_func);
return (UNCONF);
}
@@ -329,7 +331,7 @@ bios_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
if ((pdi = bios_getdiskinfo(name[1])) == NULL)
return ENXIO;
return sysctl_rdstruct(oldp, oldlenp, newp,
- pdi, sizeof(*bios_diskinfo));
+ pdi, sizeof(*bios_diskinfo));
case BIOS_CNVMEM:
return sysctl_rdint(oldp, oldlenp, newp, cnvmem);
case BIOS_EXTMEM: