Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/audio Rearrange some KASSERT and debug messages, to ...
details: https://anonhg.NetBSD.org/src/rev/32fb502ce5af
branches: trunk
changeset: 962235:32fb502ce5af
user: isaki <isaki%NetBSD.org@localhost>
date: Sun Jul 07 06:14:21 2019 +0000
description:
Rearrange some KASSERT and debug messages, to sync with others.
diffstat:
sys/dev/audio/audio.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diffs (61 lines):
diff -r 671697b2ef99 -r 32fb502ce5af sys/dev/audio/audio.c
--- a/sys/dev/audio/audio.c Sun Jul 07 06:06:46 2019 +0000
+++ b/sys/dev/audio/audio.c Sun Jul 07 06:14:21 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: audio.c,v 1.24 2019/07/07 06:06:46 isaki Exp $ */
+/* $NetBSD: audio.c,v 1.25 2019/07/07 06:14:21 isaki Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -142,7 +142,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.24 2019/07/07 06:06:46 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.25 2019/07/07 06:14:21 isaki Exp $");
#ifdef _KERNEL_OPT
#include "audio.h"
@@ -2213,6 +2213,8 @@
audio_ring_t *input;
int error;
+ KASSERT(!mutex_owned(sc->sc_lock));
+
/*
* On half-duplex hardware, O_RDWR is treated as O_WRONLY.
* However read() system call itself can be called because it's
@@ -2223,8 +2225,6 @@
return EBADF;
}
- KASSERT(!mutex_owned(sc->sc_lock));
-
/* I think it's better than EINVAL. */
if (track->mmapped)
return EPERM;
@@ -2340,18 +2340,19 @@
audio_ring_t *outbuf;
int error;
+ KASSERT(!mutex_owned(sc->sc_lock));
+
track = file->ptrack;
KASSERT(track);
- TRACET(2, track, "%sresid=%zd pid=%d.%d ioflag=0x%x",
- audiodebug >= 3 ? "begin " : "",
- uio->uio_resid, (int)curproc->p_pid, (int)curlwp->l_lid, ioflag);
-
- KASSERT(!mutex_owned(sc->sc_lock));
/* I think it's better than EINVAL. */
if (track->mmapped)
return EPERM;
+ TRACET(2, track, "%sresid=%zd pid=%d.%d ioflag=0x%x",
+ audiodebug >= 3 ? "begin " : "",
+ uio->uio_resid, (int)curproc->p_pid, (int)curlwp->l_lid, ioflag);
+
if (uio->uio_resid == 0) {
track->eofcounter++;
return 0;
Home |
Main Index |
Thread Index |
Old Index