NetBSD Problem Report #52434
From www@NetBSD.org Thu Jul 27 09:03:30 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 6AC247A263
for <gnats-bugs@gnats.NetBSD.org>; Thu, 27 Jul 2017 09:03:30 +0000 (UTC)
Message-Id: <20170727090329.7ED467A28A@mollari.NetBSD.org>
Date: Thu, 27 Jul 2017 09:03:29 +0000 (UTC)
From: isaki@NetBSD.org
Reply-To: isaki@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: Dead code in audio_set_params()
X-Send-Pr-Version: www-1.0
>Number: 52434
>Category: kern
>Synopsis: Dead code in audio_set_params()
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: nat
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jul 27 09:05:00 +0000 2017
>Closed-Date: Fri Jul 28 03:30:48 +0000 2017
>Last-Modified: Tue Aug 01 23:30:02 +0000 2017
>Originator: Tetsuya Isaki
>Release: NetBSD-current
>Organization:
NetBSD
>Environment:
source code review
>Description:
Assignment to local variables play and rec has no effect
at line 5877 and 5884.
5849 audio_set_params(struct audio_softc *sc, int setmode, int usemode,
5850 audio_params_t *play, audio_params_t *rec,
5851 stream_filter_list_t *pfil, stream_filter_list_t *rfil,
5852 struct virtual_channel *vc)
5853 {
:
5872 if (setmode & AUMODE_PLAY && auconv_set_converter(sc->sc_format,
5873 VAUDIO_NFORMATS, AUMODE_PLAY, play, true, pfil) < 0)
5874 return EINVAL;
5875
5876 if (pfil->req_size > 0)
5877 play = &pfil->filters[0].param;
5878
5879 if (setmode & AUMODE_RECORD && auconv_set_converter(sc->sc_format,
5880 VAUDIO_NFORMATS, AUMODE_RECORD, rec, true, rfil) < 0)
5881 return EINVAL;
5882
5883 if (rfil->req_size > 0)
5884 rec = &rfil->filters[0].param;
5885
5886 return 0;
5887 }
>How-To-Repeat:
see source code.
>Fix:
N/A
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: kern-bug-people->nat
Responsible-Changed-By: nat@NetBSD.org
Responsible-Changed-When: Fri, 28 Jul 2017 02:44:28 +0000
Responsible-Changed-Why:
Take.
State-Changed-From-To: open->closed
State-Changed-By: nat@NetBSD.org
State-Changed-When: Fri, 28 Jul 2017 03:30:48 +0000
State-Changed-Why:
Unused/Ineffective code has been removed. Thanks for the PR!
From: "Nathanial Sloss" <nat@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/52434 CVS commit: src/sys/dev
Date: Fri, 28 Jul 2017 03:29:19 +0000
Module Name: src
Committed By: nat
Date: Fri Jul 28 03:29:19 UTC 2017
Modified Files:
src/sys/dev: audio.c
Log Message:
Remove unused code from audio_set_params.
Addresses PR kern/52434.
To generate a diff of this commit:
cvs rdiff -u -r1.373 -r1.374 src/sys/dev/audio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Soren Jacobsen" <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/52434 CVS commit: [netbsd-8] src/sys/dev
Date: Tue, 1 Aug 2017 23:25:11 +0000
Module Name: src
Committed By: snj
Date: Tue Aug 1 23:25:11 UTC 2017
Modified Files:
src/sys/dev [netbsd-8]: audio.c
Log Message:
Pull up following revision(s) (requested by nat in ticket #167):
sys/dev/audio.c: revision 1.373
sys/dev/audio.c: revision 1.374
sys/dev/audio.c: revision 1.375
Refactoring of order of auto config combinations. Most common formats
come first.
Do not exceed AUDIO_MAX_CHANNELS.
Addresses PR kern/52435.
--
Remove unused code from audio_set_params.
Addresses PR kern/52434.
--
Remove dead code from audio open. Found by isaki@.
Better error handling incase memory for the streams' ringbuffers cannot be
allocated.
Addresses PR kern/52433.
To generate a diff of this commit:
cvs rdiff -u -r1.357.2.3 -r1.357.2.4 src/sys/dev/audio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.