summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2015-07-29 21:13:32 +0000
committerratchov <ratchov@openbsd.org>2015-07-29 21:13:32 +0000
commitbc1c0b6fa92761e531f699522c52f1386b218275 (patch)
tree3cac25221dae56b766d05188b42905b661fd9d85
parentUse DMA pointer determine the number of times the audio(4) layer has (diff)
downloadwireguard-openbsd-bc1c0b6fa92761e531f699522c52f1386b218275.tar.xz
wireguard-openbsd-bc1c0b6fa92761e531f699522c52f1386b218275.zip
Fix spacing and be more verbose in printfs under #ifdef AUDIO_DEBUG.
No binary change.
-rw-r--r--sys/dev/audio.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c
index 192704b7fca..ab458b95c9e 100644
--- a/sys/dev/audio.c
+++ b/sys/dev/audio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: audio.c,v 1.137 2015/07/28 21:04:28 ratchov Exp $ */
+/* $OpenBSD: audio.c,v 1.138 2015/07/29 21:13:32 ratchov Exp $ */
/*
* Copyright (c) 2015 Alexandre Ratchov <alex@caoua.org>
*
@@ -223,7 +223,8 @@ audio_buf_rdiscard(struct audio_buf *buf, size_t count)
{
#ifdef AUDIO_DEBUG
if (count > buf->used) {
- panic("audio_buf_rdiscard: bad count = %zu\n", count);
+ panic("audio_buf_rdiscard: bad count = %zu, "
+ "start = %zu, used = %zu\n", count, buf->start, buf->used);
}
#endif
buf->used -= count;
@@ -240,7 +241,8 @@ audio_buf_wcommit(struct audio_buf *buf, size_t count)
{
#ifdef AUDIO_DEBUG
if (count > (buf->len - buf->used)) {
- panic("audio_buf_wcommit: bad count = %zu\n", count);
+ panic("audio_buf_wcommit: bad count = %zu, "
+ "start = %zu, used = %zu\n", count, buf->start, buf->used);
}
#endif
buf->used += count;
@@ -1461,7 +1463,7 @@ audio_write(struct audio_softc *sc, struct uio *uio, int ioflag)
*/
mtx_enter(&audio_lock);
if (uio->uio_resid > 0 && (ioflag & IO_NDELAY)) {
- if (sc->play.used == sc->play.len ) {
+ if (sc->play.used == sc->play.len) {
mtx_leave(&audio_lock);
return EWOULDBLOCK;
}