Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Remove duplicated code.



details:   https://anonhg.NetBSD.org/src/rev/97cfc85f0a31
branches:  trunk
changeset: 356115:97cfc85f0a31
user:      isaki <isaki%NetBSD.org@localhost>
date:      Sat Sep 02 13:28:11 2017 +0000

description:
Remove duplicated code.
For hwvc, audio_calc_blksize() appears soon again.
For user vc, the userland format and HW format are separeted, so
audio_calc_blksize() here is no longer necessary.  In addition,
vc->sc_mpr.blksize is already initialized in audio_open().

diffstat:

 sys/dev/audio.c |  14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)

diffs (42 lines):

diff -r 6eea6a6f180f -r 97cfc85f0a31 sys/dev/audio.c
--- a/sys/dev/audio.c   Sat Sep 02 13:22:51 2017 +0000
+++ b/sys/dev/audio.c   Sat Sep 02 13:28:11 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.404 2017/09/02 13:22:51 isaki Exp $        */
+/*     $NetBSD: audio.c,v 1.405 2017/09/02 13:28:11 isaki Exp $        */
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
@@ -148,7 +148,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.404 2017/09/02 13:22:51 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.405 2017/09/02 13:28:11 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -4610,13 +4610,6 @@
                vc->sc_rparams = rp;
        }
 
-       /* Play params can affect the record params, so recalculate blksize. */
-       if (nr > 0 || np > 0 || reset) {
-               if (nr > 0)
-                       audio_calc_blksize(sc, AUMODE_RECORD, vc);
-               if (np > 0)
-                       audio_calc_blksize(sc, AUMODE_PLAY, vc);
-       }
 #ifdef AUDIO_DEBUG
        if (audiodebug > 1 && nr > 0) {
            audio_print_params("audiosetinfo() After setting record params:",
@@ -4706,9 +4699,6 @@
                        audio_calc_blksize(sc, AUMODE_PLAY, vc);
                sc->sc_pr.blksize = vc->sc_mpr.blksize;
                sc->sc_rr.blksize = vc->sc_mrr.blksize;
-       } else {
-               vc->sc_mpr.blksize = sc->sc_pr.blksize;
-               vc->sc_mrr.blksize = sc->sc_rr.blksize;
        }
 
        if (hw->commit_settings && sc->sc_opens == 0) {



Home | Main Index | Thread Index | Old Index