Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/audio Adjust debug message. Inspired from PR kern/5...



details:   https://anonhg.NetBSD.org/src/rev/1977acd38802
branches:  trunk
changeset: 451408:1977acd38802
user:      isaki <isaki%NetBSD.org@localhost>
date:      Tue May 21 12:52:57 2019 +0000

description:
Adjust debug message.  Inspired from PR kern/54177.

diffstat:

 sys/dev/audio/audio.c |  32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diffs (83 lines):

diff -r 4eb4a277a0bf -r 1977acd38802 sys/dev/audio/audio.c
--- a/sys/dev/audio/audio.c     Tue May 21 09:58:15 2019 +0000
+++ b/sys/dev/audio/audio.c     Tue May 21 12:52:57 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.7 2019/05/13 08:50:25 nakayama Exp $       */
+/*     $NetBSD: audio.c,v 1.8 2019/05/21 12:52:57 isaki Exp $  */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -149,7 +149,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.7 2019/05/13 08:50:25 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.8 2019/05/21 12:52:57 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -580,11 +580,7 @@
 static int audio_sysctl_multiuser(SYSCTLFN_PROTO);
 #if defined(AUDIO_DEBUG)
 static int audio_sysctl_debug(SYSCTLFN_PROTO);
-#endif
-#if defined(DIAGNOSTIC) || defined(AUDIO_DEBUG)
 static void audio_format2_tostr(char *, size_t, const audio_format2_t *);
-#endif
-#if defined(AUDIO_DEBUG)
 static void audio_print_format2(const char *, const audio_format2_t *) __unused;
 #endif
 
@@ -6751,7 +6747,12 @@
        if (ptrack) {
                pchanges = audio_track_setinfo_check(&pfmt, pi);
                if (pchanges == -1) {
-                       TRACET(1, ptrack, "check play.params failed");
+#if defined(AUDIO_DEBUG)
+                       char fmtbuf[64];
+                       audio_format2_tostr(fmtbuf, sizeof(fmtbuf), &pfmt);
+                       TRACET(1, ptrack, "check play.params failed: %s",
+                           fmtbuf);
+#endif
                        return EINVAL;
                }
                if (SPECIFIED(ai->mode))
@@ -6760,7 +6761,12 @@
        if (rtrack) {
                rchanges = audio_track_setinfo_check(&rfmt, ri);
                if (rchanges == -1) {
-                       TRACET(1, rtrack, "check record.params failed");
+#if defined(AUDIO_DEBUG)
+                       char fmtbuf[64];
+                       audio_format2_tostr(fmtbuf, sizeof(fmtbuf), &rfmt);
+                       TRACET(1, rtrack, "check record.params failed: %s",
+                           fmtbuf);
+#endif
                        return EINVAL;
                }
                if (SPECIFIED(ai->mode))
@@ -6894,14 +6900,8 @@
        }
 
        if (changes) {
-               if (audio_check_params(fmt) != 0) {
-#ifdef DIAGNOSTIC
-                       char fmtbuf[64];
-                       audio_format2_tostr(fmtbuf, sizeof(fmtbuf), fmt);
-                       printf("%s failed: %s\n", __func__, fmtbuf);
-#endif
+               if (audio_check_params(fmt) != 0)
                        return -1;
-               }
        }
 
        return changes;
@@ -7662,7 +7662,7 @@
        return true;
 }
 
-#if defined(DIAGNOSTIC) || defined(AUDIO_DEBUG)
+#if defined(AUDIO_DEBUG)
 static void
 audio_format2_tostr(char *buf, size_t bufsize, const audio_format2_t *fmt)
 {



Home | Main Index | Thread Index | Old Index