Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Remove meaningless sc_blkset.



details:   https://anonhg.NetBSD.org/src/rev/7c967eef4827
branches:  trunk
changeset: 355880:7c967eef4827
user:      isaki <isaki%NetBSD.org@localhost>
date:      Sun Aug 20 03:13:04 2017 +0000

description:
Remove meaningless sc_blkset.
audio_calc_blksize() checks whether sc_blkset is set but
it seems to be always cleared before calling audio_calc_blksize().

diffstat:

 sys/dev/audio.c    |  13 ++-----------
 sys/dev/audiovar.h |   4 +---
 2 files changed, 3 insertions(+), 14 deletions(-)

diffs (94 lines):

diff -r cc3a400dbee4 -r 7c967eef4827 sys/dev/audio.c
--- a/sys/dev/audio.c   Sun Aug 20 03:02:36 2017 +0000
+++ b/sys/dev/audio.c   Sun Aug 20 03:13:04 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audio.c,v 1.401 2017/08/20 03:02:36 isaki Exp $        */
+/*     $NetBSD: audio.c,v 1.402 2017/08/20 03:13:04 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.401 2017/08/20 03:02:36 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.402 2017/08/20 03:13:04 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -2146,7 +2146,6 @@
            sizeof(vc->sc_pfilters));
        vc->sc_draining = false;
        vc->sc_pbus = false;
-       vc->sc_blkset = false;
        vc->sc_lastinfovalid = false;
        vc->sc_swvol = 255;
        vc->sc_recswvol = 255;
@@ -2633,9 +2632,6 @@
        struct audio_stream *rb;
        int *blksize;
 
-       if (vc->sc_blkset)
-               return;
-
        if (mode == AUMODE_PLAY) {
                rb = vc->sc_pustream;
                parm = &rb->param;
@@ -4077,7 +4073,6 @@
        /* default parameters */
        vc->sc_rparams = sc->sc_vchan_params;
        vc->sc_pparams = sc->sc_vchan_params;
-       vc->sc_blkset = false;
 
        AUDIO_INITINFO(&ai);
        ai.record.sample_rate = sc->sc_vchan_params.sample_rate;
@@ -4120,7 +4115,6 @@
        /* default parameters */
        vc->sc_rparams = audio_default;
        vc->sc_pparams = audio_default;
-       vc->sc_blkset = false;
 
        AUDIO_INITINFO(&ai);
        ai.record.sample_rate = vc->sc_rparams.sample_rate;
@@ -4625,7 +4619,6 @@
 
        /* Play params can affect the record params, so recalculate blksize. */
        if (nr > 0 || np > 0 || reset) {
-               vc->sc_blkset = false;
                if (nr > 0)
                        audio_calc_blksize(sc, AUMODE_RECORD, vc);
                if (np > 0)
@@ -4714,7 +4707,6 @@
                        audio_clear_intr_unlocked(sc, vc);
                        cleared = true;
                }
-               vc->sc_blkset = false;
                if (nr > 0)
                        audio_calc_blksize(sc, AUMODE_RECORD, vc);
                if (np > 0)
@@ -4722,7 +4714,6 @@
                sc->sc_pr.blksize = vc->sc_mpr.blksize;
                sc->sc_rr.blksize = vc->sc_mrr.blksize;
        } else {
-               vc->sc_blkset = true;
                vc->sc_mpr.blksize = sc->sc_pr.blksize;
                vc->sc_mrr.blksize = sc->sc_rr.blksize;
        }
diff -r cc3a400dbee4 -r 7c967eef4827 sys/dev/audiovar.h
--- a/sys/dev/audiovar.h        Sun Aug 20 03:02:36 2017 +0000
+++ b/sys/dev/audiovar.h        Sun Aug 20 03:13:04 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: audiovar.h,v 1.63 2017/08/15 04:42:56 isaki Exp $      */
+/*     $NetBSD: audiovar.h,v 1.64 2017/08/20 03:13:04 isaki Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -125,8 +125,6 @@
 #define AUOPEN_WRITE   0x02
        u_char                  sc_mode;        /* bitmask for RECORD/PLAY */
 
-       bool                    sc_blkset;      /* Blocksize has been set */
-
        uint8_t                 *sc_sil_start;  /* start of silence in buffer */
        int                     sc_sil_count;   /* # of silence bytes */
        bool                    sc_pbus;        /* output DMA in progress */



Home | Main Index | Thread Index | Old Index