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/a30a4915eab5
branches:  trunk
changeset: 842488:a30a4915eab5
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 cf567ca22ccc -r a30a4915eab5 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