summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2017-03-11 12:15:36 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2017-03-11 12:15:36 +0000
commita89ee65d966542a3b812d2223ff7bf2a31b01baa (patch)
tree1776a695d1f4cb45ed9eb2bd836f79f5f27292d6 /sys/arch
parent459e63e02a0f96049410679f592b841a9b521025 (diff)
Fix uninitilized variables (confusion between enc and p->encoding
and between prec and p->precision). Found by jsg@, thanks.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/luna88k/cbus/nec86hw.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/arch/luna88k/cbus/nec86hw.c b/sys/arch/luna88k/cbus/nec86hw.c
index f70e11227a1..8284140ac97 100644
--- a/sys/arch/luna88k/cbus/nec86hw.c
+++ b/sys/arch/luna88k/cbus/nec86hw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nec86hw.c,v 1.4 2016/09/14 06:12:19 ratchov Exp $ */
+/* $OpenBSD: nec86hw.c,v 1.5 2017/03/11 12:15:35 ratchov Exp $ */
/* $NecBSD: nec86hw.c,v 1.13 1998/03/14 07:04:54 kmatsuda Exp $ */
/* $NetBSD$ */
@@ -214,7 +214,6 @@ nec86hw_set_params(void *addr, int mode, int usemode, struct audio_params *p,
{
register struct nec86hw_softc *sc = (struct nec86hw_softc *) addr;
int rate_type = NEC86HW_RATE_TYPE(sc->sc_cfgflags);
- u_int prec, enc;
if ((p->channels != 1) && (p->channels != 2))
return EINVAL;
@@ -226,8 +225,8 @@ nec86hw_set_params(void *addr, int mode, int usemode, struct audio_params *p,
p->encoding = AUDIO_ENCODING_SLINEAR_LE;
}
sc->channels = p->channels;
- sc->precision = prec;
- sc->encoding = enc;
+ sc->precision = p->precision;
+ sc->encoding = p->encoding;
sc->hw_orate_bits = nec86hw_rate_bits(sc, p->sample_rate);
sc->sc_orate = p->sample_rate = sc->hw_orate =
nec86hw_rate_table[rate_type][sc->hw_orate_bits];