Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Use hztoms() instead of incorrect calculation.
details: https://anonhg.NetBSD.org/src/rev/a11c3afb673f
branches: trunk
changeset: 452190:a11c3afb673f
user: isaki <isaki%NetBSD.org@localhost>
date: Fri Jun 21 09:34:30 2019 +0000
description:
Use hztoms() instead of incorrect calculation.
This makes spkr work on HZ=1024 like alpha.
diffstat:
sys/dev/spkr_audio.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (36 lines):
diff -r 9d2b4f9b413a -r a11c3afb673f sys/dev/spkr_audio.c
--- a/sys/dev/spkr_audio.c Fri Jun 21 07:05:02 2019 +0000
+++ b/sys/dev/spkr_audio.c Fri Jun 21 09:34:30 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spkr_audio.c,v 1.7 2019/05/08 13:40:17 isaki Exp $ */
+/* $NetBSD: spkr_audio.c,v 1.8 2019/06/21 09:34:30 isaki Exp $ */
/*-
* Copyright (c) 2016 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spkr_audio.c,v 1.7 2019/05/08 13:40:17 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spkr_audio.c,v 1.8 2019/06/21 09:34:30 isaki Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -70,7 +70,7 @@
#ifdef SPKRDEBUG
aprint_debug_dev(self, "%s: %u %d\n", __func__, xhz, ticks);
#endif /* SPKRDEBUG */
- audiobell(sc->sc_audiodev, xhz, ticks * (1000 / hz),
+ audiobell(sc->sc_audiodev, xhz, hztoms(ticks),
sc->sc_spkr.sc_vol, 0);
}
@@ -83,7 +83,7 @@
aprint_debug_dev(self, "%s: %d\n", __func__, ticks);
#endif /* SPKRDEBUG */
if (ticks > 0)
- audiobell(sc->sc_audiodev, 0, ticks * (1000 / hz),
+ audiobell(sc->sc_audiodev, 0, hztoms(ticks),
sc->sc_spkr.sc_vol, 0);
}
Home |
Main Index |
Thread Index |
Old Index